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 2008 Forums
 Transact-SQL (2008)
 how to query multiple result to one line?

Author  Topic 

wappibz
Starting Member

3 Posts

Posted - 2009-07-02 : 05:14:53
Hi, I am new to sql query, here is mu question:
I have a table, like below:
id name tag
1 a tag1
1 a tag2
1 a tag3
2 b tag2
2 b tag4
3 c tag5

how can I query it to the result like below:
id name tag
1 a tag1|tag2|tag3
2 b tag2|tag4
3 c tag5

Thanks!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-02 : 05:16:03
See http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254


Microsoft SQL Server MVP

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

wappibz
Starting Member

3 Posts

Posted - 2009-07-02 : 05:47:22
Thanks Peso! Very good, exactly what I need.
Cheers!
Go to Top of Page
   

- Advertisement -