简体   繁体   中英

inserting data from one mysql table into another mysql table using a form

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:

table 1

id_student, studentname, studentnric, studentno, dateofbirth, address, phone, courses, session

table 2

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

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM