创建触发器时出现......for the right syntax to use near ‘‘ at line 12

良好的习惯需要慢慢养成,我最近开始不定时写博客,主要内容都是开发中遇到的问题,以及解决方式。
今天是解决了触发器创建失败报语法错误的问题。

其实这问题从昨天开始就出现了,我是第一次使用触发器,只会简单的使用。话不多说,直接上代码

CREATE TRIGGER trig2
AFTER UPDATE
ON `y`.`counselor` 
FOR EACH ROW 
BEGIN
	IF (select count(id) from `x`.`t_staff` where `create_date_time`=OLD.update_time)>0
		THEN
			UPDATE `x`
  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
根据提供的引用内容,您在创建触发器遇到了语法错误。具体错误信息是"check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 8"。根据错误提示,这个问题是由于在第8行附近的语法错误导致的。 请检查您的代码,确保在第8行附近没有任何语法错误。根据错误提示,您还可以检查与您使用的MySQL服务器版本相对应的手册,以找到正确使用语法的相关信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [创建触发器出现......for the right syntax to use near ‘‘ at line 12](https://blog.csdn.net/weixin_45808463/article/details/109196994)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [mysql触发器 ERROR 1064 (42000):...the right syntax to use near '' at line...](https://blog.csdn.net/weixin_42681124/article/details/86550096)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [创建存储过程报错:1064 - You have an error in your ... check the manual that corresponds to your MySQ](https://blog.csdn.net/qq_42347255/article/details/111687505)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值