Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- a.foo, COUNT(*) AS c
- FROM table1 a
- INNER JOIN table2 b ON a.id = b.id
- AND a.foo = b.bar
- INNER JOIN (
- SELECT id
- FROM table3
- ) AS t ON t.id = a.id
- WHERE a.id = 1
- AND a.foo = 1
- GROUP BY a.foo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement