P
Paul Bush
I want to try and do a query of the number of comments that each user
leaves for a particular post on a user's blog site. I understand that I
would need to a CountOfID from comments table that equals the ID in
entries. My question is this, is there a way to do this in just 1
query? Maybe a visual will help....
2 tables:
entries:
id (primary key)
topic
message
comments:
id (primary key)
message
postedby
Let's say I want to use that data to produce a query that returns id,
topic, message and the countof replies. Another visual...
1 | Test Topic #1 | message #1 | 3
2 | Test Topic #2 | message #2 | 0
3 | Test Topic #3 | message #3 | 8
Thanks in advance. I will be trying this on my own as well so if I
don't get back to you right away don't be offended.
- Paul Bush
leaves for a particular post on a user's blog site. I understand that I
would need to a CountOfID from comments table that equals the ID in
entries. My question is this, is there a way to do this in just 1
query? Maybe a visual will help....
2 tables:
entries:
id (primary key)
topic
message
comments:
id (primary key)
message
postedby
Let's say I want to use that data to produce a query that returns id,
topic, message and the countof replies. Another visual...
1 | Test Topic #1 | message #1 | 3
2 | Test Topic #2 | message #2 | 0
3 | Test Topic #3 | message #3 | 8
Thanks in advance. I will be trying this on my own as well so if I
don't get back to you right away don't be offended.
- Paul Bush