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 command is used to create a database in the sql server and how?
Can sub report data source be different from that of the parent report?
what are questions asked in TCS for database tester (sqlserver)for 2-3 exp?
What are two difference between sql azure and azure tables?
What xml support does the sql server extend?
What security features are available for stored procedure?
Do you know what is a with(nolock)?
Explain “not null constraint” in sql server?
What is difference between rollback immediate and with no_wait during alter database?
How to execute stored procedure in select statement sql server?
What is difference between temp table and cte?
What are the differences between having and where clause.
What is create statement?
What is proper subset of candidate key?
Do you know exporting and importing utility?