Click here to Skip to main content
15,907,396 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm having


VB
Column Name          Column Code
jayaram                 BC1


jayaram                 BC2


jayaram                 BC65


jayaram                 BC66 




I need it as


VB
Column name                Column Code

Jayaram                    BC1,BC2,BC65,BC56 
Posted
Comments
Member 10517120 5-Mar-14 1:35am    
How to do this in Sql MY query involves Grouping and also joins

Did you search Google for this? I got this, customize it
Converting row values in a table to a single concatenated string[^]
 
Share this answer
 
Comments
Member 10517120 5-Mar-14 2:13am    
seems complex im beginner
thatraja 5-Mar-14 2:58am    
Start writing query using those examples(from the link), come back when you face some issue. Besides, you got Solution 2.
Member 10517120 6-Mar-14 0:15am    
i had done it in the front End
thatraja 6-Mar-14 1:57am    
Good but db side is better than front end
Use this Query and better you learn about it.refer solution1

SQL
select stuff((select ',',+cast(column_code as varchar)  from table1 where column_name='Jayaram' for XML Path ('')),1,1,'')
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900