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-07.sql 293B

12345678910
  1. SELECT vendor_name,
  2. COUNT(DISTINCT li.account_number) AS number_of_gl_accounts
  3. FROM vendors v
  4. JOIN invoices i
  5. ON v.vendor_id = i.vendor_id
  6. JOIN invoice_line_items li
  7. ON i.invoice_id = li.invoice_id
  8. GROUP BY vendor_name
  9. HAVING number_of_gl_accounts > 1
  10. ORDER BY vendor_name