You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exercise-04.sql 308B

12345678
  1. SELECT account_description, COUNT(*) AS line_item_count,
  2. SUM(line_item_amount) AS line_item_amount_sum
  3. FROM general_ledger_accounts gl
  4. JOIN invoice_line_items li
  5. ON gl.account_number = li.account_number
  6. GROUP BY account_description
  7. HAVING line_item_count > 1
  8. ORDER BY line_item_amount_sum DESC