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 382B

12345678910
  1. SELECT vendor_name, i.invoice_id, invoice_sequence, line_item_amount
  2. FROM vendors v JOIN invoices i
  3. ON v.vendor_id = i.vendor_id
  4. JOIN invoice_line_items li
  5. ON i.invoice_id = li.invoice_id
  6. WHERE i.invoice_id IN
  7. (SELECT DISTINCT invoice_id
  8. FROM invoice_line_items
  9. WHERE invoice_sequence > 1)
  10. ORDER BY vendor_name, i.invoice_id, invoice_sequence