触发器语法错误 求指教

meran meran 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

create FUNCTION f_get_triggerinfo(v_alarm_event_id int) returns int
begin
declare v_ret int;
select
(case when (exists (select 1 from alarm_trigger_client where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 1 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_email where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 10 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_io where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 100 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_message where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 1000 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_popup_video where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 10000 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_preset where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 100000 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_tvwall where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 1000000 else 0 end case)
+
(case when (exists (select 1 from alarm_trigger_vrm where alarm_event_id=alarm_event.alarm_event_id and valid_flag='1')) then 10000000 else 0 end case)
into v_ret
from alarm_event where alarm_event_id=v_alarm_event_id;
return v_ret;
end;



求指教啊亲
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
meran
MySQL 57,062 成员 56,759 内容