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
 General SQL Server Forums
 New to SQL Server Programming
 Join to single row

Author  Topic 

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2008-08-04 : 11:42:55
I have two tables

Users
userid username nickname
1 xxxx xxxx
2 xxxxx xxxxx
3 xxxxx xxxxx

tags
userid tagname
1 hello
2 hi
1 bye

When I select the rows of user=1 it displayed as two rows as the tags table has two rows. How to merge the tags in single row with multiple columns and the another problem is my user have more than 10 tags(countless).

I need to display as
Userid username tag1 tag23 tag3 tag....
1 xxxx hello hi bye

please help.

____________
Praba

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-04 : 12:48:01
do you have any other unique valued column in tags?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-05 : 04:39:48
Which version of SQL server are you using?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2008-08-05 : 08:04:23
I am using sql server8.

____________
Praba
Go to Top of Page

cutepraba
Yak Posting Veteran

53 Posts

Posted - 2008-08-05 : 08:05:02
quote:
Originally posted by visakh16

do you have any other unique valued column in tags?



i have tagid with GUID

____________
Praba
Go to Top of Page
   

- Advertisement -