-3

I'm having a temp table in which I'm inserting data. In temp table data is ok and I want to update another table with temp table data. I'm new to SQL My Query is:

update result_table set result_table.a = temp.a, 
                        result_table.b = temp.b 
from temp where temp.a= 1

I'm deleting the data in temp table and inserting data again in temp table and updating the result table.

How can I do this?

1 Answers1

0
INSERT INTO TABLE_A
SELECT * FROM TABLE B
[INSERT WHERE CONDITIONS HERE]

Just make sure that the table structure of both tables are the same.

zbads
  • 135
  • 1
  • 9