开发者

How to import selected fields in mysql

For example I 开发者_开发技巧have a table. With a field Idnumber. And the field has 10 data(ex: 1234, 1235, 1236, etc) And I have another table, subjects. Is it possible to import the data that is in the table student(field idnumber) and put it on the table subjects(field idnumber)? So that I won't have to copy and paste the data that is in the source table to the destination table. I'm talking about phpmyadmin


Perhaps something like this?

INSERT INTO `subjects`(`idnumber`) SELECT `idnumber` FROM `studends`;

The INSERT command can use data provided by a simple SELECT, so you can "copy" data from one table to another using this kind of syntax.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜