The below mysql query yeilds the following result:
SELECT COUNT(ProgramType) AS Counter
FROm credential_state
GROUP BY ProgramType;
Results:
Counter
4
7
7
I would like return the max from the above (7). The following query is giving my an error that says: Every derived table must have its own alias. Not sure what I'm doing wrong.
SELECT MAX(Counter) AS MAX FROM(SELECT COUNT(ProgramType) AS Counter
FROm credential_state
GROUP BY ProgramType);
Please HELP!