I have this cross_reference table,
post_id | cat_id
-----------------
3 11
-----------------
3 2
-----------------
4 5
-----------------
4 6
-----------------
4 2
-----------------
5 8
-----------------
5 13
The problem is that this query does not return anything….
SELECT DISTINCT post_id FROM posts_categories WHERE cat_id = 11 AND cat_id = 2
I expect it to return ‘3’…
What am I doing wrong?
It is actually
OR, notAND. Or better:Though I’d expect it to return 3 and 4.
UPDATE: (based on the comment)