求教:同一条sql语句,在navicat里面执行能正常得出结果,在java程序中返回null

作者:首页

图片 1

SELECTb.hoursAShours,IFNULL(a.avgNumber,0)ASavgNumberFROM(SELECTDATE_FORMAT(HOUR,'%H')+1-1hoursFROM(SELECT@cdate:=DATE_ADD(@cdate,INTERVAL-1HOUR)HOURFROMt_platform_logLIMIT0,24)fORDERBYhours)bLEFTJOIN(SELECTDATE_FORMAT(f_create_time,'%H')+1-1hours,ROUND(count(*)/(timestampdiff(DAY,'2019-10-27','2019-11-05')+1),2)avgNumberFROMt_platform_logWHERE1=1ANDf_create_time='2019-10-2700:00:00'ANDf_create_time='2019-11-0523:59:59'GROUPBYDATE_FORMAT(f_create_time,'%H'))aONa.hours=b.hoursnavicat中执行的结果:java程序中执行的结果:java代码:

本文由澳门十三第发布,转载请注明来源

关键词: