重複の可能性:
特定の条件下でINSERTを防止するためのMySQLトリガー
MySQLBEFORE INSERT TRIGGER
で、条件付きでデータ挿入をスキップするにはどうすればよいですか?
delimiter //
drop trigger if exists test_trigger //
create trigger test_trigger before insert on t
for each row
begin
set @found := false;
#Some code
if @found then
#How to skip the data insertion under condition?
end if;
end //
delimiter ;