SQL query to get posts from multiple categories but not in a category
You had to use LEFT JOIN to simplify the stuff. By the way, the same can be accomplished using WP_Query and I actualy don’t understand why you don’t want to use it. Also I’ve changed the way you write the query and I’ve not use the hardcoded $table_prefix for answer to be useful for others … Read more