题解 | #确定哪些订单购买了 prod_id BR01#
确定哪些订单购买了 prod_id 为 BR01 的产品(一)
https://www.nowcoder.com/practice/b692b0174c0444fa9452aee2d082fbbb
SELECT cust_id, order_date FROM Orders WHERE order_num IN ( SELECT order_num FROM OrderItems WHERE prod_id = 'BR01' ) ORDER BY order_date;
子查询,跟上题一样,就是加了个排序。
有时候会忽略排序,所以还是最后加个;,以此来确保无误