I want to count the total post made by each member, for instance,
member table,
member_id
1
2
3
4
5
6
post table,
post_id member_id
1 1
2 1
3 1
4 2
5 3
the result I am after,
member_id totalPost
1 3
2 1
3 1
4 0
5 0
6 0
My working query,
SELECT *
FROM root_members_cfm AS m
LEFT JOIN root_posts AS n
ON n.member_id = m.member_id
1 Answer