954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

INSERT columns into rows

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.

daniyalnawaz
Newbie Poster
9 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

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

tesuji
Master Poster
721 posts since Apr 2008
Reputation Points: 158
Solved Threads: 98
 

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

daniyalnawaz
Newbie Poster
9 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

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 :icon_wink:

krs,
tesu

tesuji
Master Poster
721 posts since Apr 2008
Reputation Points: 158
Solved Threads: 98
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You