Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Need Query Help

Author  Topic 

medtech26
Posting Yak Master

169 Posts

Posted - 2002-08-28 : 14:30:43
Anyone can help me with the following SQL Query?

If my table is:

John A
John B
John C
Simon D
Simon A

Need a query to generate:
John A,B,c
Simon D,A

I would really appreciate if someone can help. This is easily feasable in access using crosstab query but is not supported on Sql server.


AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2002-08-28 : 14:57:13
You can search this site (both forums and articles) for how to do a CROSSTAB in SQL Server. You might also want to look into the COALESCE() function.

Go to Top of Page

joshb
Yak Posting Veteran

52 Posts

Posted - 2002-08-28 : 16:45:55
Along the lines of what Mark suggested here's a link to a great article on using the COALESCE function to create CSVs.

[url]http://www.sqlteam.com/item.asp?ItemID=2368[/url]

Go to Top of Page
   

- Advertisement -