A report needs one row per region with the total sales amount rather than every underlying transaction. Which approach best fits?

Published
  1. Use HAVING for the aggregate condition.
  2. Use a LEFT JOIN from customers to orders.
  3. Use a window ranking function and retain the first row per customer.
  4. Use GROUP BY region with SUM of the sales amount.

Comments — 0