可惜 MySQL
沒有 MINUS
的支援。
SELECT `產品名稱` FROM product
WHERE `產品代號` NOT IN (
SELECT DISTINCT product.`產品代號` FROM sales, product, customer
WHERE sales.`產品代號` = product.`產品代號`
AND sales.`客戶代號` = customer.`客戶代號`
AND customer.`縣市` LIKE '%台北市%'
AND sales.`交易年` = 85
);