涉及到max函数的链接表sql写法
牛客每个人最近的登录日期(二)
http://www.nowcoder.com/practice/7cc3c814329546e89e71bb45c805c9ad
select u.name, c.name, date from user u,client c,login l
where l.user_id = u.id and l.client_id = c.id
and (user_id, date) in (select user_id, max(date) from login
group by user_id)