题解 | 每个顾客购买的最新产品名称
每个顾客购买的最新产品名称
https://www.nowcoder.com/practice/6ff37adae90f490aafa313033a2dcff7
with t1 as( select customer_name, a.customer_id customer_id, product_name, row_number()over(partition by a.customer_id order by order_date desc) rn from orders a inner join customers b on a.customer_id=b.customer_id inner join products c on a.product_id=c.product_id ) select customer_id, customer_name, product_name latest_order from t1 where rn=1
上海得物信息集团有限公司公司福利 1208人发布