我有一个表,它是 mysql 中相关的 GPS 应用程序。每当我从 asp.net 应用程序执行时,它都会显示胎儿错误。所以我决定在 mysql 中运行,执行 SP 需要 1 分钟以上(正好 70 秒)。是否可以解决问题。
更多信息:
表 1:server_gpsdata(它包含 gps 数据。它每 10 秒从 gps 设备锁定一次)。
select * from server_gpsdata SD
INNER JOIN mstcab MC on MC.cabid= SD.cabid
INNER JOIN server_tblstatus TS on TS.statusid= MC.CabStatusid
INNER JOIN carmaster CM on CM.carid= MC.carid
INNER JOIN cabtype CT on CT.cabtypeid= CM.sizeid
where date(SD.cur_datetime) =current_date and
MC.Cabid not in (select D.cabid from trncabdriver D
where date(D.logintime)=current_date) and
SD.gpsdataid in (select max(SGD.gpsdataid) from server_gpsdata SGD
where date(SGD.cur_datetime)=current_date
group by SGD.cabid);