在phpMyAdmin的v4.5.5.1中,我正在运行以下MySQL代码;
SELECT Date, DOW, Week, Year, logdate, Month, monum, netID, Logins,
creds, newb, netCnt, TOD, netCnt, activity
FROM (SELECT logdate
,activity
,DATE( logdate ) AS Date
,DAYOFWEEK( logdate ) AS DOW
,WEEK( logdate,0 ) AS Week
,YEAR( logdate ) AS Year
,DATE_FORMAT( logdate, '%M' ) AS Month
,DATE_FORMAT( logdate, '%m' ) AS monum
,CONVERT( netID,UNSIGNED INTEGER ) AS netID
,COUNT( callsign ) AS Logins
,COUNT( IF(creds <> '',1,NULL) ) AS creds
,COUNT( IF(comments LIKE '%first log in%',1,NULL) ) AS newb
,count( DISTINCT netID ) AS netCnt
,SUM( DISTINCT netID) AS allCnt
,SEC_TO_TIME( SUM(timeonduty) ) AS TOD
FROM NetLog
WHERE netID <> 0
AND activity NOT LIKE '%TEST%'
AND netcall LIKE '%W0KCN%'
AND substr(logdate,1,4) = 2017
GROUP BY Month, netID WITH ROLLUP ) AS t
ORDER BY t.logdate , logins
它运行得很好并且返回我需要的所有东西但是...... 我在'FROM(SELECT logdate'
)的第3行得到了三个错误我也在第23行'GROUP BY Month,netID WITH ROLLUP'得到五个错误AS t'...
这些意味着什么,我应该解决它们,当然我该如何解决它们?
答案 0 :(得分:2)
你说:
在v4.5.5.1中
PHPMyAdmin当前版本是4.7.7,you can get it here。
我已经在我的4.7.3版本中运行了您的查询,这在运行时不会显示这些错误。
问题是你的版本4.5.5是在2015年发布的,所以很老了...错误得到修复,代码得到改进,PHPMyAdmin在处理高级SQL语法检查方面总是落后一点。
我会将评论stated by tadman放在第二位
phpMyAdmin不像MySQL Workbench这样强大的工具,所以如果您可以选择使用Workbench