Advertisement
DimitarVasilev

Untitled

Jul 13th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.28 KB | None | 0 0
  1. --3.1How many vehicles have more than one installation event?
  2. SELECT COUNT(1) FROM
  3. (SELECT COUNT(v.vehicle_id), v.vehicle_id
  4. FROM generic_event ge, vehicle v
  5. WHERE v.vehicle_id=ge.vehicle_id
  6. AND ge.name LIKE 'Traxxeo install'
  7. GROUP BY v.vehicle_id
  8. HAVING COUNT(v.vehicle_id )>1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement