Hi,
Can we get records of single column into a single row? If it is possible, then what will be sql statement for this.
Thanks.
Can we get records in a single row
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pravin MoreRank #1,419 · 1.2K reputationPosted Dec 1, 2011, 8:34 PM EST
hi Alok,
you can surely do it like below.....
declare @data varchar(max)
SELECT @data = COALESCE(@data + ', ', '') + EMPName from Empoyee
select @data
Thanks,
Pravin.
Alok PandeyRank #271 · 9.3K reputationPosted Dec 1, 2011, 9:02 PM EST