我試圖做一個觸發器,它會從一個基於表中選擇刪除另一個表中的行刪除基於多行選擇
表operatorpositions
列operator
,line
,pos
表positiontags
色譜柱line
,position
,tag
表operatortags
co lumns operator
,tag
我的觸發看起來像這樣
CREATE TRIGGER removeOperatorPosition AFTER DELETE ON operatorpositions
FOR EACH ROW
BEGIN
DELETE FROM operatortags WHERE gen = NEW.operator
AND tag = (SELECT tag FROM positiontags WHERE position = NEW.pos AND line = NEW.line);
END;
問題是可以有多個標籤爲一個位置,這樣子查詢將返回多行。我如何需要改變它,以便它可以使用多個標籤?
工作,只是不得不將'新'改爲'舊' – 2012-03-30 12:05:11