1
我是數據庫開發新手。請幫助我創建一個將數據從一個表移動到另一個表的觸發器。使用更新觸發器將數據從一個表移動到另一個表
我有兩個表,其中一個包含「事務狀態」,我想將事務狀態更改的記錄移動到另一個已完成事務的表中。因此,一個表中的值將被刪除,並會插入到另一個表中。
請指正在以下觸發:
create trigger transaction_state after update on test_archive for each row begin
insert into test_me(select * from test_archive where new.Transaction_status = 2);
delete from test_archive where new.Transaction_status = 2;
end;
4年後爲我節省了很多時間:) ..謝謝! – DntFrgtDSemiCln 2015-06-09 17:00:53