问题
查询数据库中积分最多的用户
SELECT MAX(integral_left) AS integral_left, ACCOUNT_ID
FROM integral_total GROUP BY ACCOUNT_ID ORDER BY `integral_left` desc;
SELECT MAX(integral_left) AS integral_left, ACCOUNT_ID FROM integral_total ORDER BY `integral_left` desc;
查询出来的结果如下:
可以看到同样是104477对应的accout_id的值是不一样的。
记录一下MAX()函数的正确用法。