题解 | 每个顾客最近一次下单的订单信息
每个顾客最近一次下单的订单信息
https://www.nowcoder.com/practice/4762ea22b0eb42ceb4f0a972c56d24c4
select
orders.order_id,
customer_name,
orders.order_date
from
(
select
customer_id,
max(order_date) as order_date
from
orders
group by
customer_id
) as t1
left join orders on t1.order_date = orders.order_date
and t1.customer_id = orders.customer_id
left join customers on customers.customer_id=orders.customer_id
order by customer_name asc

顺丰集团工作强度 335人发布