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 do you understand by recursive stored procedures?
Which sql server is best?
What is sql view?
What are trace flags and mention a few common trace flags used with sql server?
Tell me what is the significance of null value and why should we avoid permitting null values?
How many types of attribute relationships are there? : sql server analysis services, ssas
Can multiple columns be used in sql group by clause in ms sql server?
How do I find the sql server database version?
optimization techinques
What is the user of Primary key?
What is used to replicate sessions between instances in coldfusion clusters?
What are the advantages of policy management?
how can you check the level of fragmentation on a table? : Sql server administration
How many columns can we include on clustered index ?
Explain following error properties?