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 instances when triggers are appropriate?
How to add more data to the testing table in ms sql server?
Explain in brief how sql server enhances scalability of the database system?
What is an indexed view?
What is collation sensitivity?
Write a query to find 5th highest amount paid from the customer table.
What Are the Main Features of SQL Azure?
How to get nth highest salary from employee table.
What are the source of constraints?
What are the steps you will take to improve the performance of a poor performing query?
What are the reporting services components?
What do you mean by normalisation?
What are the benefits of filtered indexes?
How to create a large table with random data for index testing in ms sql server?
List the different types of collation sensitivities in sql server?