题解 | #返回购买价格为 10 美元或以上产品的顾客列表#
返回购买价格为 10 美元或以上产品的顾客列表
https://www.nowcoder.com/practice/827eb2a210c64ccdb8ec28fe4c50c246
SELECT DISTINCT cust_id FROM ( SELECT o.cust_id, oi.item_price FROM Orders o JOIN OrderItems oi ON o.order_num = oi.order_num ) AS subquery WHERE item_price >= 10;
先将表连接,建立新表,然后从新表中筛选