DELIMITER //
CREATE trigger T_PlayersNum
before insert on Players for each row
begin
If (Select Count(distinct accountnum) From Players) >=3 then
Raiserror('不能超过3个',16,-1);
RollBack Transaction;
Return;
End if;
End;//
delimiter ;请问我这个触发器问题在哪里 每次执行到Raiserror('不能超过3个',16,-1);就出错.

解决方案 »

  1.   

    为什么一天了CSDN上就是没人回答我呢 我要疯掉了...
      

  2.   

    我真的是实在查找不到地方可以参考的 希望有人指点 求求你们了...我不知道if() then 
    后该怎么写 虽然我知道MS SQL怎么写但是MYSQL真的不知道 急死我了啊
      

  3.   

    Explicit or implicit commit is not allowed in stored function or trigger.