MYSQL, Copy selected fields from one table to another

后端 未结 8 1751
情深已故
情深已故 2020-12-23 09:58

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

相关标签:
8条回答
  • 2020-12-23 10:39

    Insert into Delivery (DeliveredDate, appid, DownloadSize, UploadSize) select Delivered, Appid, DownloadSize,UploadSize from Delivery_Summary;

    0 讨论(0)
  • 2020-12-23 10:45

    The query for copy data from one table to another is:

    Insert into table2 (field1, field2)  select field1, field2 from table1
    


    If you want to copy only selected values, then use where clause in query

    Insert into table2 (field1, field2)  select field1, field2 from table1 where field1=condition
    


    0 讨论(0)
提交回复
热议问题