是否可以选择子查询的最大值。我尝试了以下SELECT MAX(SELECT COUNT(lid)AS count FROM Lessons GROUP BY day),但它显然失败了。有什么建议吗?
答案 0 :(得分:2)
为什么不
SELECT COUNT(lid) AS count
FROM Lessons
GROUP BY day
ORDER BY count desc
limit 1
答案 1 :(得分:1)
SELECT MAX(myCount) FROM (SELECT COUNT(lid) AS myCount FROM Lessons GROUP BY day) AS sub Query
我相信这就是你要找的东西。