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 2005 Forums
 Transact-SQL (2005)
 Group_concat or string concate in sql server 2000

Author  Topic 

jiya
Starting Member

2 Posts

Posted - 2011-06-20 : 06:45:18
how to concat string base on search result?
like I have a table

Name Leaves
zahid 2 SL
sajid 1 CL
zahid 3 PL
jiya 1 CL
jiya 1 SL
zahid 3 SL
sajid 5 PL
fatima 2 CL


I want the Result like that

Name Leaves
zahid 2 SL, 3 PL, 3 SL
jiya 1 CL, 1 SL
Sajid 1 CL, 5 PL
Fatima 2 CL

plz help me. i m new in sql and using sql 2000. is Group_concat work on it? if its work than what i did wrong with it?? plz


jiya

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-06-20 : 07:01:41
Take a look here: http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/

There are several methods described that won't with with SQL Server 2000 but most of them will.
Go to Top of Page

jiya
Starting Member

2 Posts

Posted - 2011-06-20 : 07:15:37
thank u :) but i can not still understand these queries. i will try it again to understand

jiya
Go to Top of Page
   

- Advertisement -