繁尘※随之绽放
2021-05-19 17:05
采纳率: 100%
浏览 50

新手上路,这个错误是什么意思呢,求解!

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • CSDN专家-Time 2021-05-19 17:13
    已采纳
    create trigger t4
    before
    insert
    on ord
    for each row
    begin
        declare has_num int;
        select good_num into has_num from good where good_id = new.good_id;
        
        if has_num < new.ord_num then
    
        set new.ord_num = has_num;
    
        end if;
    
        update good set good_num =0 where good_id = new.good_id;   
    
    end$
    评论
    解决 1 无用
    打赏 举报
查看更多回答(3条)

相关推荐 更多相似问题