Home Forums Article Discussions Article Discussions by Author Discuss content posted by pramod singla SQL Server 2012 Concat RE: SQL Server 2012 Concat
Carlo Romagnano
SSC-Insane
Points: 22603
More actions
July 9, 2013 at 1:55 am
#1630675
Some formatting with CONCAT:
SELECT
concat
(
'Name: ',t.name
,CHAR(9) + 'Last name: ',t.lastname
,CHAR(9) + 'Total: ',SUM(e.Score)
) AS csv_line
FROM Students t
JOIN Exams e
ON t.ID = e.ID_Student
GROUP BY t.name
,t.lastname