The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Excluding forums in SQL query
I need some help with an SQL query. I'm trying to run a query to list the top posters but exclude some specific forums using vb_forumid, but it's not recognized. Here's the query BEFORE trying to exclude forums that works fine:
Code:
SELECT count(vb_post.postid) AS vb_postcount, vb_user.username FROM vb_post AS vb_post LEFT JOIN vb_user AS vb_user ON (vb_user.userid = vb_post.userid) WHERE dateline > UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) GROUP BY vb_post.userid ORDER BY vb_postcount DESC HTML Code:
error number: 1054 error desc: Unknown column 'vb_forumid' in 'where clause' Code:
SELECT count(vb_post.postid) AS vb_postcount, vb_user.username FROM vb_post AS vb_post LEFT JOIN vb_user AS vb_user ON (vb_user.userid = vb_post.userid) WHERE dateline > UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 1 MONTH)) AND vb_forumid NOT IN (10,588,589,591,592,593,594,595,597,599,601,608,609,641,644,645,646,647,649,650,652,654,671,689,737,739,740,741,782,783,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1239,1240,1241,1242,1274,1275,1278,1279,1280,1289,1290,1292) GROUP BY vb_post.userid ORDER BY vb_postcount DESC |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|