Q&A for pro webmasters
Select P.Id, count(*) as totalPosts From Posts P JOIN Users U ON(P.Id = U.Id) Group By P.Id