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)
 Help with SQL Query

Author  Topic 

SoupDragon
Starting Member

2 Posts

Posted - 2005-03-17 : 06:21:12
Hi, I have a table which consists of two fields
UCN and LISTREF

UCN | LISTREF
1001 | AA101
1001 | AA102
1001 | AB200
1004 | AA101
1004 | AB200
1005 | AA102
..
..
etc

what i need is to be able to produce an output like
1001 | AA101,AA102,AB200
1004 | AA101,AB200
1005 | AA102

Can this be done, I have used SQL a lot but I do not know what to start looking for in any searches etc

Thanks.

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-03-17 : 06:30:38
look at
http://www.sqlteam.com/item.asp?ItemID=2368
under "The New and Improved Approach"

then put that code into a UDF that you call in you select statement.

Go with the flow & have fun! Else fight the flow
Go to Top of Page

SoupDragon
Starting Member

2 Posts

Posted - 2005-03-17 : 07:19:58

Works Perfectly

Many Thanks
Go to Top of Page
   

- Advertisement -