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 in brief about Microsoft SQL server?
Define cursor locking
What are horizontal and vertical scaling?
What is the process of normalising?
What are character string data types in ms sql server?
What is normalization? Describe its different types.
you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration
What are different types of join?
How to get a list of columns in a view using the "sp_columns" stored procedure?
What is the difference between index seek vs. Index scan?
What is sql server english query?
How to Update from select query in sql server?
What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?
Explain having clause?
Explain the difference between HTTP and HTTPS in database?