by trowftd · 13y ago · 0 comments
In fact, you can take out the second part of the inner join condition and move it in the where clause, like this (execution plan will stay the same):
SELECT posts.* FROM posts
INNER JOIN post_tags pt ON pt.post_id = posts.id
WHERE posts.author IN ('Joe', 'Jane') AND pt.tag IN ('foo', 'bar', 'baz')
ORDER BY post_date DESC;