insert data from one table to another

后端 未结 2 975
别跟我提以往
别跟我提以往 2021-01-26 19:09

I have 2 different tables but the columns are named slightly differently. I want to take information from 1 table and put it into the other table. I need the info from table 1 p

2条回答
  •  不思量自难忘°
    2021-01-26 19:31

    This should work. You don't need to worry about the identify field in Table2.

    INSERT INTO Table2
     (client_last_name, client_first_name, taskDescription, category)
     (SELECT clientLastName, clientFirstName, incidentDescription, category
      FROM Table1
      WHERE info_field IS NOT NULL)
    

提交回复
热议问题