結合 WHERE 與 HAVING
你想了解哪些國家為 eSymphony 帶來最多營收。更具體地說,你想列出發票總金額超過 $100 的國家。有人通知你在巴黎登錄的資料可能有誤,所以你決定在分析中排除巴黎的發票。
要回答這個問題,你需要同時使用 WHERE 和 HAVING 來篩選資料。
本練習屬於課程
Oracle SQL 入門
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
-- Select the BillingCountry and the total billing amount
SELECT ___, ___(___)
FROM Invoice
-- Group by billing country
___
-- Exclude groups with an invoice amount of more than 100
___