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
What are key constraints?
Why do we partition data?
What are the differences in Clustering in SQL Server 2005 and 2008 or 2008 R2?
Tell me about the approaches which you used to counter the DI problems.
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
How to query multiple tables jointly?
What are temporal tables in sql server 2016?
What is the maximum size of a dimension? : sql server analysis services, ssas
How many joins in sql server?
How can I tell if sql server is 32 or 64 bit?
Explain contrast amongst grouped and non-bunched records?
Can we use where clause with group by?
How to enter unicode character string literals in ms sql server?
Explain how many normalization forms?
Explain database normalization?