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 / miller

try using Pivot. for details follow the link
http://msdn.microsoft.com/en-us/library/ms177410.aspx link

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is unpivot?

775


What do you do in data exploration

720


Why I am getting this error when renaming a database in ms sql server?

724


How to create a simple user defined function in ms sql server?

741


Where the sql logs gets stored?

715






What is the optimization being performed in oracle and SQL Server?

797


How to insert multiple rows with a subquery?

722


What do you mean by table and field in sql?

738


Can a table be created inside a trigger?

723


What is row_number function?

738


Explain SSRS Architecture?

163


What is SQL Azure Fabric?

106


How to locate and take substrings with charindex() and substring() functions?

697


How will you go about resolving deadlocks?

694


how can you select rexcord(rows) from table A which is not present in Table B . Id being the FK in Table B referencing to ID Table A

1415