there is a table having two columns no and name
and the data is
1 A
2 B
3 C
write a query that will result a horizontal output
A,B,C
Answer Posted / piyush sachan
DECLARE @List VARCHAR(8000)
SELECT @List = ISNULL(@List + ',', '') +names
FROM NewNew
SELECT @List
Orrrrrr
DECLARE @List VARCHAR(8000)
SELECT @List = COALESCE(@List + ',', '') +names
FROM NewNew
SELECT @List
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain an automatic checkpoint
What is model database? : SQL Server Architecture
what are the disadvantages of cursors? : Sql server database administration
What are the recovery models for a database?
What is a with(nolock)?
Explain about remote stored procedure?
What is for xml in sql server?
What are click through reports?
How to insert new line characters into strings?
Explain error handling in ssis?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
What are the events recorded in a transaction log?
How much is a sql server license?
What is forward - only cursors / read only cursor?
what are the important architecture components of SSRS?