Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT route_id
- FROM insert_route
- WHERE insert_id IN (21,24)
- AND
- route_id IN (48,49,44,50,55,43,51,25,24,52,47,31,53)
- AND
- route_id NOT IN
- (
- SELECT route_id
- FROM insert_route
- WHERE insert_id IN (12)
- )
- GROUP BY route_id
- HAVING count( DISTINCT insert_id ) = 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement