mysqlmysql-workbench

MYSQL, Copy selected fields from one table to another


In MySQL, How do I copy a FIELD with all RECORDS from TABLE1 to TABLE2 which corresponds to a primary key ie: EMPLOYEE no.?


Solution

  • Try this

    INSERT INTO `table2` (`field_name2`) SELECT `field_name` FROM `table1`