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
How to retrieve field values using mssql_result()?
What is 'Join' and explain its various types.
What do you mean by sql server agent?
Describe different Processing Modes offered by SSRS?
What is shrink log file?
How to get a list all databases on the sql server?
Explain the advantages of merge replication?
What does REVERT do in SQL Server 2005?
What is an indexed view?
Can multiple columns be used in sql group by clause in ms sql server?
What are the steps to process a single select statement?
What is xdr?
Is the primary key column of a table an index in ms sql server?
Explain stored procedure?
What are the methods used to protect against sql injection attack?