Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
This is a Table:

SQL
Name	company	address	age	city	country
Dachu	Tess	bigstreet	24	Vellore	India
Dachu	banyan	NULL	24	Null	India
Dachu	eccma	NULL	24	chennai	India
Dachu	brandsource	bigstreet	24	Null	India
siva	Tess	samllstreet	25	chennai	india
siva	banyan	samllstreet	25	Null	india
siva	omaga	sristreet	25	Vellore	india
Ram	eccma	mainstreet	23	Vellore	India
Ram	tess	NULL	23	Vellore	India
Ram	orange	blankstreet	23	vanyambadi	India


I want this o/p:

SQL
Name	company	ADDRESS	age	city	country
dachu	tess,banyan,eccm,brandsource	bigstret	24	Vellore,chennai	india
siva	tess,banyan,omaga	samllstreet,sristreet	25	chennai,vellore	india
Ram	eccma,tess,orange	Mainstreet,blankstreet	23	vellore,vanyambadi	india


using distinct name wise
Posted

1 solution

Tons of examples you'll find here[^].

3 ways to achieve that is here: SQL SERVER – Create Comma Separated List From Table[^]
 
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