【问题标题】:inserting data from one mysql table into another mysql table using a form使用表单将数据从一个mysql表插入另一个mysql表
【发布时间】:2011-04-08 19:05:00
【问题描述】:

我还是 mysql 脚本的新手,我需要关于上述问题的帮助。

我有两个表由相同的字段名称组成,除了一个字段如下:

表 1

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

表 2

id_graduate, studentname, studentnric, studentno, courses, session

我想要完成的是,将第一个表中的数据放入第二个表中

【问题讨论】:

    标签: mysql select insert


    【解决方案1】:
    INSERT INTO table2
    SELECT id_student as id_graduate, studentname, studentnric, studentno, courses, session 
    FROM table1
    

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 2013-04-25
        • 2012-12-05
        • 1970-01-01
        • 2014-08-12
        • 2012-05-01
        • 2018-04-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多