Skip to main content

Select max() from count()

That just means MySQL insists that you give the inner SELECT a name, like:

SELECT MAX(counted) FROM
(
    SELECT COUNT(*) AS counted
    FROM table_actions
    WHERE status = "good"
    GROUP BY user
) AS counts;

Comments