I have one table with two columns that I want to split into two tables:
table Columns: user_id, col1, col2
New tables:
B: user_id, col1
C: user_id, col2
I want to do:
INSERT INTO B (user_id, col1) SELECT user_id,col1 from A;
INSERT INTO C (user_id,col2) SELECT user_id, col2 from A;
But I want to do this in one statement. The table is large, so I just want to do it in one pass. Is there any way to do this?
thank.
source
share