Facebook
From Gracious Lion, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 124
  1. SELECT c.name,
  2.        COUNT(DISTINCT e.instituition) AS count_inst
  3. FROM company AS c
  4. JOIN people AS p ON c.id = p.company_id
  5. JOIN education AS e ON p.id = e.person_id
  6. GROUP BY c.name
  7. ORDER BY count_inst DESC
  8. LIMIT 5;