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 > Data Access, Manipulation & Batch Languages > ANSI SQL > Turning one record into multiple records...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-14-03, 15:16
EOS3 EOS3 is offline
Registered User
 
Join Date: Feb 2003
Posts: 5
Turning one record into multiple records...

Whoops...

I have the following multi-column table...

A 01 02 03

and I want to SELECT in such a way that the result set looks like this...

A 01
A 02
A 03

Seems simple - but I'm missing it... Thanks in advance!

Last edited by EOS3; 02-14-03 at 15:49.
Reply With Quote
  #2 (permalink)  
Old 02-14-03, 20:14
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
if the columns are called PK, COL1, COL2, ...

select PK, COL1
union all
select PK, COL2
union all
...


rudy
Reply With Quote
  #3 (permalink)  
Old 02-17-03, 02:31
EOS3 EOS3 is offline
Registered User
 
Join Date: Feb 2003
Posts: 5
Thanks so much...

for the help! Works like a champ!
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