-- My Answer of Example:
-- 主查询
SELECT c.name, o.total_amount
FROM customers c
INNER JOIN orders o ON c.customer_id = o.customer_id
WHERE c.customer_id IN (
-- 子查询
SELECT customer_id
FROM orders
WHERE total_amount > 200
)
====================
-- Level 24
-- 主查询
SELECT c.name, o.total_amount
FROM customers c
INNER JOIN orders o ON c.customer_id = o.customer_id
WHERE EXISTS (
-- 子查询
SELECT DISTINCT customer_id
FROM orders
)
看示例代码的时候,发现示例给的代码是跑不出来的。是否存在错误? 以下是我自己测试可以运行的代码 -- Level 23
==================== -- Level 24