题目如下:
请问下,为什么我使用此条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