gpt4 book ai didi

mysql - 使用表单将一个mysql表中的数据插入到另一个mysql表中

转载 作者:可可西里 更新时间:2023-11-01 07:54:38 26 4
gpt4 key购买 nike

我在 mysql 脚本方面还是很新,在上述问题上我需要帮助。

我有两个包含相同字段名称的表,除了一个字段如下:

表1

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

表2

id_graduate, studentname, studentnric, studentno, courses, session

我想要完成的是,将第一个表中的数据获取到第二个表中

最佳答案

INSERT INTO table2
SELECT id_student as id_graduate, studentname, studentnric, studentno, courses, session
FROM table1

关于mysql - 使用表单将一个mysql表中的数据插入到另一个mysql表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5599666/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com