I'm trying to come up with an sql query that will count the words in every first post in a specific forum and give me a sum, but I don't know how to connect the posts with the first_post_id in the threads table.
Thanks for that Andy, I believe that will give me a list of all first posts in threads right? How do I use that to count the words in the messages now?
This is the query that can count the words (well, close enough at least) inside the posts:
Code:
SELECT SUM(LENGTH(`message`) - LENGTH(REPLACE(`message`, ' ', ''))+1)
FROM xf_post
My members use a specific forum to write their travel stories/narratives. So the first post in each thread is the story, and then members comment/discuss. I want to understand how big these posts are (most are pretty massive). So by counting total number of words in all 1st posts in a forum, I will then divide that by the number of threads, and I will have an average word count per story.