MySQL Forums :: InnoDB :: Inseret records from one table to many


Advanced Search

Re: Inseret records from one table to many
Posted by: atjun yadav ()
Date: March 23, 2017 12:37PM

I want to have this following two table from the main t_csv table

t_pcategory
===========
parent_id parent_category
1 Main
2 pc-22
3 Unanai-parent
4 Aqu-parent
5 Afga-parent
6 Indana-parant
7 Tib-parent

from parent_id 3 to 7 inserted from the t_csv file. The parent_id are generated
automatically and are unique.


t_category
id category parent_category
1 Ayurvedic Meds 1
2 Pet Meds 1
3 Best Seller 1
4 Unanai 3
5 Aqu 4
6 Afga 5
7 Indana 6
8 Tib 7

Now the above autogenerated parent_id becomes the parent_category in t_category
i,e from parent_category from 3 to 7 is same as that of parent_id in t_pcategory.

Options: ReplyQuote


Subject Views Written By Posted
Inseret records from one table to many 57 atjun yadav 03/23/2017 06:37AM
Re: Inseret records from one table to many 27 Peter Brawley 03/23/2017 11:24AM
Re: Inseret records from one table to many 30 atjun yadav 03/23/2017 12:37PM
Re: Inseret records from one table to many 53 Peter Brawley 03/23/2017 01:18PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.