>>175
こんな感じか
select
カテゴリ名,
(select count(*) from posts where category_id=t.id ) as cnt
from categoires t

オプティマイザが賢くないならjoinの方が早いかもしれんが

>>177
group byは?