sql查询语句问题(同样的语句不同数据库结果)
查询出来结果为20000条记录在sqlserver查询语句为如下SELECTcount(station.id)asrecordcountFROMstationleftOU...
查询出来结果为20000 条记录
在sqlserver 查询语句为如下
SELECT count(station.id)as recordcount FROM station left OUTER JOIN gprsconnect on station.falseip=gprsconnect.falseip where (datediff(minute,gprsconnect.gprstime,getdate())>=9 or gprsconnect.gprstime IS NULL) and station.g_id IN (1,4,12,13,14,15,16,17,18,19,20,21,22,23,24)
mysql中语句如下
SELECT count(station.id)as recordcount FROM station left OUTER JOIN gprsconnect on station.falseip=gprsconnect.falseip where (TIMESTAMPDIFF(minute,gprsconnect.gprstime,now())>=9 or gprsconnect.gprstime IS NULL) and station.g_id IN (1,4,12,13,14,15,16,17,18,19,20,21,22,23,24)
结果很让人失望 在sqlserver 结果瞬间出来 但是mysql中耗时30秒 求解???????
结果为 recordcount=20000 展开
在sqlserver 查询语句为如下
SELECT count(station.id)as recordcount FROM station left OUTER JOIN gprsconnect on station.falseip=gprsconnect.falseip where (datediff(minute,gprsconnect.gprstime,getdate())>=9 or gprsconnect.gprstime IS NULL) and station.g_id IN (1,4,12,13,14,15,16,17,18,19,20,21,22,23,24)
mysql中语句如下
SELECT count(station.id)as recordcount FROM station left OUTER JOIN gprsconnect on station.falseip=gprsconnect.falseip where (TIMESTAMPDIFF(minute,gprsconnect.gprstime,now())>=9 or gprsconnect.gprstime IS NULL) and station.g_id IN (1,4,12,13,14,15,16,17,18,19,20,21,22,23,24)
结果很让人失望 在sqlserver 结果瞬间出来 但是mysql中耗时30秒 求解???????
结果为 recordcount=20000 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询