Advertisement
johncarlson21

Untitled

Oct 11th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.27 KB | None | 0 0
  1. SELECT route_id
  2. FROM insert_route
  3. WHERE insert_id IN (21,24)
  4. AND
  5. route_id IN (48,49,44,50,55,43,51,25,24,52,47,31,53)
  6. AND
  7. route_id NOT IN
  8. (
  9. SELECT route_id
  10. FROM insert_route
  11. WHERE insert_id IN (12)
  12. )
  13. GROUP BY route_id
  14. HAVING count( DISTINCT insert_id ) = 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement