啊啊啊啊啊啊啊啊啊 我打了老半天結果不小心按到上一頁
說好的自動儲存呢QQQQQQQQQQQQQQQQQQQ
崩潰
時間快到了... 我一千多字都沒ㄌQQ 崩潰
先上 placeholder... 乾
本篇有 3 sections:
6. Subqueries
7. Common Table Expressions
8. Set operators (Union 那些)
之前這邊打了一些東西,但忘了QQ
文章提供了一些比較複雜的使用案例
WHERE
後面當過濾條件EXISTS
比 IN
快INSERT INTO customers_archive
SELECT *
FROM customers
WHERE NOT EXISTS(
SELECT 1
FROM
orders
WHERE
orders.customernumber = customers.customernumber
);
DELETE FROM customers
WHERE EXISTS(
SELECT
1
FROM
customers_archive a
WHERE
a.customernumber = customers.customerNumber);