题解: select user_id,max(date) as d from login group by user_id order by user_id 注意 group by 和 order by 都是 user_id