SELECT MAX(count),id_university FROM (
SELECT COUNT(*) as count, id_university FROM `users`
where status = 2 AND id_university>0
GROUP BY id_university
)AS counts
目前上面的查询给了我id_university = 1而不是相应的值。
如何获得具有最大数量的相应id_university?
答案 0 :(得分:2)
使用JViewport
和ORDER BY
LIMIT