If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > column wise data to row data wise data in sql

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-11, 23:38
nishajk nishajk is offline
Registered User
 
Join Date: Jun 2009
Posts: 11
column wise data to row data wise data in sql

Hi

I have get 3 columns in a select query. how can show these 3 columns in row wise

Regards
Njk
Reply With Quote
  #2 (permalink)  
Old 12-28-11, 03:40
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Code:
SELECT 'column1=', column1 FROM daTable
UNION ALL
SELECT 'column2=', column2 FROM daTable
UNION ALL
SELECT 'column3=', column3 FROM daTable
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-28-11, 04:00
nishajk nishajk is offline
Registered User
 
Join Date: Jun 2009
Posts: 11
Thank u

Njk
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On