MySQL Forums
Forum List  »  Newbie

Re: Move several fields from multiple tables to a new table
Posted by: Peter Brawley
Date: November 18, 2021 09:11AM

create table materials( matid int unsigned primary key, desc varchar(128) ... );

For each of the materials0n tables ...

insert ignore into materials select id, desc from materials0n;

... then change the foreign key specs in tables that refer to materials0n tables.

Now the fun begins ... inevitably, the same item will be represented by different ids and probably different descriptions. No programmattic solution for that, just slogging.

Options: ReplyQuote


Subject
Written By
Posted
Re: Move several fields from multiple tables to a new table
November 18, 2021 09:11AM


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.