MySQL subquery with WHERE filters not working as expected
Seems like I had to use a larger subquery and join it with the main query. Works fine this way.  Not sure why it did not work the above way though...
SELECT tags_x.tag_id, tags.tag_name, questions.question_id,X.num
FROM tags_x
LEFT JOIN tags ON tags.tag_id = tags_x.tag_id  
LEFT JOIN questions ON questions.question_id = tags_x.question_id 
LEFT JOIN 
(SELECT tags_x.tag_id, count(tags_x.tagsx_id) AS num
FROM tags_x
LEFT JOIN questions ON tags_x.question_id = questions.question_id
LEFT JOIN tags ON tags.tag_id = tags_x.tag_id
WHERE questions.suspended =0 AND questions.offline = 0 AND tags.tag_name IS NOT NULL
GROUP BY tags.tag_id) AS X ON X.tag_id=tags.tag_id  
WHERE questions.question IS NOT NULL
ORDER BY `questions`.`question_id` ASC