ここスタックでいくつかの質問/回答を読みましたが、必要なものが見つかりませんでした。
次のテーブルがあるとします。
col0 col1 col2 col3 col4
---- ---- ---- ---- ----
8 1 a b c
8 2 a b c
8 3 a b c
9 1 a b c
9 2 a b c
そして私のソフトウェアは:
INSERT INTO testtable ([col0],[col1],[col2],[col3],[col4])
VALUES ('8','4','a','b','c')
この擬似コードのようなトリガーを作成するにはどうすればよいですか:
On insert when col1 = '4'
delete existing rows where col0 is the same (8 in this case)
** except for the new row I've just added **