题解 | #对顾客ID和日期排序#
对顾客ID和日期排序
https://www.nowcoder.com/practice/fa4eb4880d124a4ead7a9b025fe75b70
select -- 从所有列中过滤出两列 cust_id, order_num from ( select * from Orders order by cust_id, order_date desc ) temp -- 子查询按照客户Id和时间排序,并返回所有列
对顾客ID和日期排序
https://www.nowcoder.com/practice/fa4eb4880d124a4ead7a9b025fe75b70
select -- 从所有列中过滤出两列 cust_id, order_num from ( select * from Orders order by cust_id, order_date desc ) temp -- 子查询按照客户Id和时间排序,并返回所有列
相关推荐