![]() |
SQL Query for number of posts per user group
Hi,
I'm trying to get the number of posts for users in a specific user group in a specific timeframe and am using this query: Code:
SELECT posts, username, email from vb_user An error occurred while attempting to execute your query. The following information was returned. error number: 1054 error desc: Unknown column 'dateline' in 'where clause' Can anyone help me with this? I have four 4.2.2 PL4 forum sets and this happens on all four If I take out the dateline sections, it works, but it gives me stats for all time, not just the date range I'm looking for. What am I doing wrong? |
The user table does not have a dateline column, that's why it doesn't work.
You can use: joindate, lastvisit, lastactivity, lastpost. By the way it's easier to write WHERE usergroupid IN (10, 62) for the first WHERE statement. |
I think you want something like this:
Code:
SELECT COUNT(*) FROM vb_post |
Quote:
--------------- Added [DATE]1445287851[/DATE] at [TIME]1445287851[/TIME] --------------- Quote:
--------------- Added [DATE]1445289086[/DATE] at [TIME]1445289086[/TIME] --------------- I've been playing around with it a bit and I've almost got the following to work: Code:
SELECT COUNT(postid) AS count, user.username |
Try:
HTML Code:
SELECT COUNT(*) AS posts, post.userid |
I found it! Thanks to your help and guidance:
Code:
SELECT COUNT(postid) AS count, user.username --------------- Added [DATE]1445289865[/DATE] at [TIME]1445289865[/TIME] --------------- Ok, one last (I hope) question: How do I get email addresses to also show along with the user ID in the resultant list? |
All times are GMT. The time now is 12:59 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|