I have a table in SQL Server:
M_AllParty_HDR(ID, PartyName, AgentId, IsDeleted, IsActive)
I want to select all PartyName of any specific AgentID in single row and PartyName should be distinguish by Comma symbol. I have done following to solve this problem
select PartyName+','
from M_AllParty_HDR
where AgentID=1613 and IsDeleted=0 and IsActive=1
The Output coming is
Rajesh mishra
Siddhi traders
Kamat tiwari
which is 3 rows. But i want output as follows:-
Rajesh mishra,Siddhi traders,Kamat tiwari
How is it possible? Please help me someone here.