INSERT columns into rows

Reply

Join Date: May 2008
Posts: 9
Reputation: daniyalnawaz is an unknown quantity at this point 
Solved Threads: 0
daniyalnawaz daniyalnawaz is offline Offline
Newbie Poster

INSERT columns into rows

 
0
  #1
Jun 29th, 2008
hi,

i have a table called exam,
it has following columns
-----------------------------------------------------------------
| ID | QUESTION | OPTION_1 | OPTION_2 | OPTION_3 |
-----------------------------------------------------------------

now I've normalized it and put the exam options in another table called 'exam_option' table which keeps these options in rows instead of columns. Since i have a lots of data i want to put this information in my new table. Is there anyway to create such query whihc can do that.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 296
Reputation: tesuji is on a distinguished road 
Solved Threads: 42
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: INSERT columns into rows

 
0
  #2
Jun 29th, 2008
Hi

This is a very simple standard task you always have to solve, if one-to-many related tables need to get together. Is that not related to your other nice thread, E-commerce data design issue of May 12th, 2008, what is still dangling about?


krs,
tesu
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 9
Reputation: daniyalnawaz is an unknown quantity at this point 
Solved Threads: 0
daniyalnawaz daniyalnawaz is offline Offline
Newbie Poster

Re: INSERT columns into rows

 
0
  #3
Jun 30th, 2008
Originally Posted by tesuji View Post
Hi

This is a very simple standard task you always have to solve, if one-to-many related tables need to get together. Is that not related to your other nice thread, E-commerce data design issue of May 12th, 2008, what is still dangling about?


krs,
tesu
No its for my different project. I figured out the E-commerce problem with your and others help. Actually the system grew into a whole inventory managements system so lots of option became a part of SKUs and some options were actually products offered in package with other products. By the way thank you for your help.

Well i've retrieved and inserted my data through php script. Still any way though SQL will be appreciated.

Thank You!
Daniyal
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 296
Reputation: tesuji is on a distinguished road 
Solved Threads: 42
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: INSERT columns into rows

 
0
  #4
Jul 1st, 2008
Hi daniyal

you may cast a glance on http://www.daniweb.com/forums/thread132147.html to get your inspiration from on how to solve your problem

krs,
tesu
Last edited by tesuji; Jul 1st, 2008 at 9:46 pm.
Information is moving—you know, nightly news is one way, of course, but it's also moving through the blogosphere and through the Internets. I promise you I will listen to what has been said here, even though I wasn't here. Ann and I will carry out this equivocal message to the world. I'm the master of low expectations.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC