The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
query problem
Hi, can someone suggest why this query isnt working?
SELECT thread.threadid, COUNT(post.postid) AS posts FROM thread INNER JOIN post ON thread.threadid = post.threadid WHERE (UNIX_TIMESTAMP()-post.dateline) < 86400 GROUP BY thread.threadid, COUNT(post.postid) ORDER BY COUNT(post.postid) DESC when i test it in phpMyAdmin i get an invalid use of group function error. cheers. |
#2
|
||||
|
||||
you can't group by threadid and a COUNT() value the same time..
i also think you cannot group by a count() value at all |
#3
|
|||
|
|||
after a bit of fiddling about i got it working
SELECT thread.threadid, thread.title, thread.lastposter, COUNT(post.postid) AS numposts FROM thread INNER JOIN post ON thread.threadid = post.threadid WHERE (UNIX_TIMESTAMP()-post.dateline) < 86400 GROUP BY thread.threadid ORDER BY numposts DESC LIMIT 10 btw, this will give the 10 most active threads during the past 24 hours. :banana: |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|