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 5.sql 438B

12345678910
  1. SELECT DISTINCT
  2. g.account_description,
  3. COUNT(line_item_amount) AS line_item_amount_count,
  4. SUM(i.line_item_amount) AS line_item_amount_sum,
  5. n.invoice_date
  6. FROM general_ledger_accounts g JOIN invoice_line_items i JOIN invoices n
  7. ON g.account_number = i.account_number AND i.invoice_id = n.invoice_id
  8. GROUP BY g.account_description
  9. HAVING n.invoice_date BETWEEN '2018-04-01' AND '2018-06-30'
  10. ORDER BY line_item_amount_sum DESC;