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 different types of indexes?
What is BLOCK statements in SQL?
What is dbcc command in sql server?
Explain syntax for viewing trigger?
What are three ways you can use an identity value inside a trigger? Why would you prefer one way over another?
SQL Server Architecture ?
What is buffer cash in sql server?
What is lock escalation and what is its purpose?
List some major differences between triggers and stored procedures?
Describe and explain about SQL native client?
Explain sql server authentication modes?
What is deploy, process and build? : sql server analysis services, ssas
What is for xml in sql server?
How adventureworkslt tables are related?
How to include text values in sql statements?