题解 | 查询订单
查询订单
https://www.nowcoder.com/practice/5ae7f48dc94f4a76b0ade40b70caf308
select
order_id
,customer_name
,order_date
from
(
select
rank() over(partition by t1.customer_id order by t1.order_date desc ) as rk
,t2.customer_name
,t1.order_id
,t1.customer_id
,t1.order_date
from orders t1
left join customers t2
on t1.customer_id = t2.customer_id
) t3
where rk <= 1


查看3道真题和解析