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.
In reply to Re: Counting rows from table1 while querying table2
by moritz
in thread Counting rows from table1 while querying table2
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |