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 / rajesh.a
declare @res varchar(max)
set @res=''
select @res=@res+name+',' from table
select @res=substring(@res,1,len-1)
print @res
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What are the system database in sql server 2005?
What are the dmvs?
List out the differences between the clustered index and non-clustered index in sql server?
What is pessimistic concurrency?
Can you use order by when defining a view?
How can you fetch alternate records from a table?
Difference between aggregate functions of sql?
What are the components of sql server service broker?
What is trigger in salesforce?
What program is used to store the data source file?
how will add additional conditions in sql?
Distinguish between nested subquery and correlated subquery?
Mention what are the core components of ssrs?
What is filter index?
How do I connect to sql server database?