|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
to group attribute values of the same id together with sql?-------------- ID Attribute 1 A 2 B 2 C 3 D 3 E 3 F -------------- How to write a sql query to convert the above table into -------------- ID NewAttribute 1 A 2 B, C 3 D, E, F -------------- Thanks a lot. Roy There are no built-in operators in t-SQL which does such concatenations and
hence it is recommended that you use a client side programming language to generate such resultset. To do this in t-SQL, you can find examples of some kludgy approaches at: http://groups-beta.google.com/group/microsoft.public.sqlserver.programming/msg/2d85bf366dd9e73e -- Anith Hi Roy,
Check this URL which help to solve you. http://www.sqlteam.com/item.asp?ItemID=256 Regards, Srikanth Raavilla Show quote "roy" <royl***@hotmail.com> wrote in message news:1122002991.229177.14340@o13g2000cwo.googlegroups.com... > Suppose I have a table like this > -------------- > ID Attribute > 1 A > 2 B > 2 C > 3 D > 3 E > 3 F > -------------- > > How to write a sql query to convert the above table into > -------------- > ID NewAttribute > 1 A > 2 B, C > 3 D, E, F > -------------- > > Thanks a lot. > Roy > |
|||||||||||||||||||||||