Home  • Database • MySQL

Copy mysql table rows from one table to another table

MySQL
Copy to existing table with same structure including related table
INSERT IGNORE INTO question_bank_certification SELECT * FROM mcq_bank_master where subject_id in(136);
INSERT IGNORE INTO question_bank_certification_detials  select * from mcq_bank_details where question_id in(select id from mcq_bank_master where subject_id in(136))
create table and copy rows from one table to another table including related table
CREATE TABLE question_bank_religion as select * from mcq_bank_master where subject_id in(143);
CREATE TABLE question_bank_religion_detials as select * from mcq_bank_details  where question_id in(select id from mcq_bank_master where subject_id in(143));

Comments 0


Share

Copyright © 2024. Powered by Intellect Software Ltd