DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   INSERT columns into rows (http://www.daniweb.com/forums/thread131723.html)

daniyalnawaz Jun 29th, 2008 12:07 pm
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.

tesuji Jun 29th, 2008 12:34 pm
Re: INSERT columns into rows
 
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

daniyalnawaz Jun 30th, 2008 11:26 am
Re: INSERT columns into rows
 
Quote:

Originally Posted by tesuji (Post 636935)
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

tesuji Jul 1st, 2008 9:46 pm
Re: INSERT columns into rows
 
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


All times are GMT -4. The time now is 12:43 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC