Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Display table raws in table coloums Expand / Collapse
Author
Message
Posted Thursday, January 17, 2013 5:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 28, 2013 1:38 AM
Points: 7, Visits: 27
my question is how to display table two rows in two columns.

pls reply my topic


Post #1408342
Posted Thursday, January 17, 2013 5:11 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Today @ 7:38 AM
Points: 859, Visits: 521
You can use PIVOT function to convert rows into columns. Bt please bear in mind that the reverse is not true.
Post #1408350
Posted Thursday, January 17, 2013 8:36 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:50 PM
Points: 13,325, Visits: 12,811
Often times a cross tab will out perform the pivot function. Take a look at the links in my signature about pivots and cross tabs. Those articles will explain the process in great detail.

_______________________________________________________________

Need help? Help us help you.

Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

Need to split a string? Try Jeff Moden's splitter.

Cross Tabs and Pivots, Part 1 – Converting Rows to Columns
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs
Understanding and Using APPLY (Part 1)
Understanding and Using APPLY (Part 2)
Post #1408465
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse