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
How to use order by with union operators in ms sql server?
What do you mean by acid?
What is a primary index?
What are the fixed server level roles? : sql server security
What is rank function?
Explain the creation and execution of a user-defined function in the sql server?
How to download microsoft sql server 2005 express edition?
What is the difference between varchar and nvarchar datatypes?
What is database white box testing?
How to start and end transact-sql statements?
Where is trigger in sql server?
What is the difference between index seek vs. Index scan?
What are the benefits and tasks of object explorer? : sql server management studio
Explain ms sql server reporting services vs crystal reports?
What is temporal data type?