我想做这样的事情:
CREATE TRIGGER addwinner AFTER INSERT ON bids
FOR EACH ROW BEGIN
IF exists(select * from wins as LT where LT.item_index=NEW.item_index) THEN
SELECT item_index, MIN( bid_amount )
FROM update_winnerslist AS a1
WHERE a1.item_index = NEW.item_index;
UPDATE wins SET email_id=NEW.emai_id, bid_amount=a1.bid_amount where wins.item_index=a1.item_index;
END IF;
END;
基本上我想要的是通过比较某些属性来使用另一个表的元组更新一个表。