关于Leecode题目中mysql函数失效问题

题目如下:

图片说明

请问下,为什么我使用此条sql进行查询时,max()函数会失效

select max(num) from my_numbers group by num having count(*) = 1 

结果如下:

图片说明

SELECT MAX(temp.num) FROM (SELECT num FROM my_numbers GROUP BY num HAVING COUNT(1)=1) AS temp

或者

SELECT MAX(num) FROM my_numbers GROUP BY num HAVING COUNT(1)=1
ORDER BY MAX(num) DESC
LIMIT 1

select max num from (select count(num) as cnt, num from table group by num having cnt = 1)