You could delete and re-insert, if the two tables have the same columns in the same order. Assuming that all records in tableB match tableA:
delete from tableA
where id in (select id from tableB)
insert into tableA
select *
from tableB;
(If all records do not match, you could use a temporary table to keep the necessary ids.)
Generally, I oppose doing insert
without a column list. In some cases, it is tolerable -- such as when tableB
was created as a subset from tableB
using *
.