SQL Server : INSERT from one table to another table

后端 未结 3 1489
温柔的废话
温柔的废话 2021-01-23 03:25

I am facing a problem regarding inserting data from one table to another table, with the same table structure, but with different column positions.

Example:

Tabl

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-23 03:40

    It's simple just reorder columns during insert:

    INSERT INTO `emp1` (Name, Salary, Age)
    SELECT Name, Salary, Age FROM `emp2`;
    

提交回复
热议问题