我在 phpmyadmin 中创建了以下触发器。
delimiter |
create trigger active after insert on event
for each row
begin
declare n int;
set n = (select follower_id from follow where circle_id=new.circle_id);
insert into activity (uid, performed_activity_id,activity_type_id) values(new.uid,new.event_id,'1');
insert into notification (sender_id,receiver_id,message)values (new.uid,n,new.title);
end;
|
我在这里遇到的问题是 select 语句返回了更多的一个值。
ERROR 1242 (21000): Subquery returns more than 1 row
如何从 select 语句中获取多个值以及如何将它们传递给 insert statemant。?