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.
精彩评论