- 11.1 子查询
- 11.2 利用子查询进行过滤
- SELECT order_num
- FROM OrderItems
- WHERE prod_id = 'RGAN01';
- -----------------------------
- SELECT cust_id
- FROM Orders
- WHERE order_num IN (20007,20008);
- 11.3 作为计算字段使用子查询
- SELECT COUNT(*) AS orders
- FROM Orders
- WHERE cust_id = '1000000001';
- 11.4 小结