Mysql 分组Top 1

in 后端 with 0 comment

主要是看到一种新的写法,记录一下

select * from table where(user_id,amount)  in (select user_id, max(amount) from table group by user_id)
Comments are closed.