I'm trying to set the maximum number to "max" An error occurred:
Error code: 1111. Invalid use of group function 0.000 seconds
SELECT max(count(*)) as max FROM ticket group by fan_fan_id;
I'm not sure what the problem is here and I'd be happy to get some help here - and I need to fix it without the "limit 1" option
SQL does not allow nested aggregate functions like the example you have shown.
The parameters of aggregate functions must be scalar expressions, not aggregate expressions.
You can do what you want:
Or another way is to sort by value in descending order and return only the first count: