Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: forum -> topics->posts count
04-07-2007, 06:38 AM #1
- Join Date
- Aug 2005
- Thanked 1 Time in 1 Post
forum -> topics->posts count
okay, so in my "posts" table i have a col called "topicid". In the topic table, there are two cols, one called "id" that matches "topicid" from the posts forum, and "forumid". I want to be able to count all posts there are in a specific forum. What would the sql query before that?
Im thinking it would be:
SELECT count(p.id) FROM posts AS p INNER JOIN topics AS t on p.topicid=t.id INNER JOIN forums AS f on t.forumid=f.id WHERE f.id = 1
Last edited by thesavior; 04-07-2007 at 07:06 AM.