in reply to Counting rows from table1 while querying table2
SELECT COUNT(c.id) FROM categories c, posts p WHERE c.id = p.catid
In Englisch that's "Count the catgeories for which a corresponding post exists" - if that's not what you want you have to clarify your question.
|
|---|