Is it possible to display all but first row from a table in sql server 2005? I have this data:
---------------------------------
| ID | Name |
---------------------------------
| 1 | John Smith |
| 2 | John Doe |
| 3 | John Thatcher |
---------------------------------
In my query I need to be able to get 'John Doe' and 'John Thatcher'. I Don't need 'ID' column to be displayed, so I can't use ROW_NUMBER here like follows:
select Name from Customers where ROW_NUMBER() over (order by Id)>1
Please advice.
Thank you.
UPDATE: Clarification: I would like my query to return only Name column but I can't use table expressions, because I'm using the query as part of string concatenation:
select stuff((select ', '+pfn.FullName from PlaintiffsFullNameView pfn where pfn.SuitId=s.Id for xml path('')),1,1,'') as "CoPlaintiffs"
Now I need to transform this query to return all but first plaintiff in a concatenated manner.
UPDATE 2: Sorry for messed up explanation, let me try it anew: I have a suits table and a plaintiffs table. (one to many) I have a requirement to display each suit with all coplaintiffs concatenated. "Coplaintiff" is any but first suit plaintiff. I can concatenate all plaintiffs and display them along with corresponding suit data (all in one row), but I can't to figure out how to concatenate all coplaintiffs and display them as string in a row column.