I have following two tables
-
Table name: thread
pk-> thread_id | thread_title | description | posted_time | Subject -
Table name: reply
pk-> reply_id | thread_id | reply
thread_id is fk
I want to count no of replies on each thread, I want output like
thread_id | thread_title | description | posted_time | Subject | No_of_replies
Here’s the query I’ve quickly come up with off of the top of my head:
This should do what you want.