mysql 作业 存储过程_mysql 作业 定时执行存储过程

mysql中的事件是不是相当于MSSQL中的作业,能定时执行存储过程?如果是的话,一个事件中能不能像MSSQL中的作业一样,执行多个存储过程?另外,mysql的存储过程中调用另一个存储过程怎...

mysql中的事件是不是相当于MSSQL中的作业,能定时执行存储过程?

如果是的话,一个事件中能不能像MSSQL中的作业一样,执行多个存储过程?

另外,mysql的存储过程中调用另一个存储过程怎么做?

DECLARE firsttime datetime;

select firsttime = (select n_Record_Date from ((select * from t_Record where s_Device_IP = '192.168.1.153' and n_Record_Type in (1, 2) order by n_Record_Date limit 0, 1) union (select * from t_RecordLs where s_Device_IP = '192.168.1.153' and n_Record_Type in (1, 2) order by n_Record_Date limit 0, 1)) as temp order by n_Record_Date limit 0, 1);

这个语句哪里错了?

(select n_Record_Date from ((select * from t_Record where s_Device_IP = '192.168.1.153' and n_Record_Type in (1, 2) order by n_Record_Date limit 0, 1) union (select * from t_RecordLs where s_Device_IP = '192.168.1.153' and n_Record_Type in (1, 2) order by n_Record_Date limit 0, 1)) as temp order by n_Record_Date limit 0, 1)是从两张联合以来的表里读取第一条记录的一个字段。

然后把读取到的字段赋值给firsttime。

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值