题解 |建立子表,用普通方法查询(无需表连接)
牛客每个人最近的登录日期(二)
http://www.nowcoder.com/practice/7cc3c814329546e89e71bb45c805c9ad
select u.name as u_n ,c.name as c_n ,a.date
from
(select user_id, max(date) as date,client_id
from login group by user_id order by user_id) a,user as u, client c
where a.user_id = u.id
and a.client_id = c.id
order by u.name
建立子表,用普通方法查询(无需表连接)