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.

demo-queries-from slides-5.sql 270B

1234567
  1. SELECT DISTINCT v1.vendor_name, v1.vendor_city,
  2. v1.vendor_state
  3. FROM vendors v1 JOIN vendors v2
  4. ON v1.vendor_city = v2.vendor_city AND
  5. v1.vendor_state = v2.vendor_state AND
  6. v1.vendor_name <> v2.vendor_name
  7. ORDER BY v1.vendor_state, v1.vendor_city;