Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT a.*
- FROM a
- LEFT JOIN b ON b.a_id = a.id
- LEFT JOIN c ON c.a_id = a.id
- WHERE COUNT(DISTINCT b.id) < COUNT(DISTINCT c.id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement