SQL Server query to display all student name in one cell seperated by ','

Amatya
Posted by Amatya under Sql Server category on | Points: 40 | Views : 2783
SQL Server query to display all student name in one cell seperated by ','

Declare @name varchar(MAX) = ''
Select @name = @name + FirstName + ', ' from tblDNFRec
Select SUBSTRING(@name,1, LEN(@name)) As FirstName


Output:
Amatya
Aditya

Comments or Responses

Login to post response