I'm still very new in mysql scripting and I need help on the above matter.
I have two table consist of same field names except one field as below:
id_student, studentname, studentnric, studentno, dateofbirth, address, phone, courses, session
id_graduate, studentname, studentnric, studentno, courses, session
What I am trying to accomplish is, to get the data in the first table into the second table
INSERT INTO table2
SELECT id_student as id_graduate, studentname, studentnric, studentno, courses, session
FROM table1
Take a look at insert into select
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.