Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Custom classifications of business objects
Custom grouping of business objects
Custom counting of business objects
10. CASE WHEN with COUNT – exercise
Summary

Instruction

Very well done! Let's do one more exercise to practice this concept.

Exercise

Washington (WA) is Northwind's primary region. How many orders have been processed by employees in the WA region, and how many by employees in other regions? Show two columns with their respective counts: orders_wa_employees and orders_not_wa_employees.

Stuck? Here's a hint!

Use the following COUNT() expression:

COUNT(CASE
  WHEN region = 'WA' THEN order_id
END)