0
私は2つのテーブルTable_A
とTable_B
を持っています。私は以下のロジックに条件付き削除とポストグルの挿入
If table A records match table B records on id
then
delete records from table A and Insert records into Table B
を行う条件付きのSQLを書くことができますどのように私は、SQL可能性が最も高いwith
delete from Table_A where Exists (select a.id from TABLE_A
join TABLE_B as b on a.id = b.id)
インサートを使用してこれを行うことができますどのようにすることです:Insert into Table_A (id) select id from TABLE_B
はい。ジオメトリの複雑さのために更新を避けようとしています –