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。
展开