I have two tables:
1) parts
part_id | part_name
2) posts
post_id | part_id | type | title | content
in posts table the post has one of three types, so in type column I put value (1 or 2 or 3)
I want to get table (with count and join) like this
part_id | part_name | count_posts_type1 | count_posts_type2 | count_posts_type3
how to do this with mysql?
example: