![]() |
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 HTML Code:
error number: 1054 Code:
SELECT count(vb_post.postid) AS vb_postcount, vb_user.username |
Column names aren't prefixed, only table names are.
Change vb_forumid to forumid. |
Thanks Dave, that's what I thought too, but when I use just forumid I get the same error:
HTML Code:
Message |
The post table does not contain a column called forumid, you'd have to LEFT JOIN the thread table.
So add LEFT JOIN vb_thread ON vb_thread.threadid = vb_post.threadid and change forumid to vb_thread.forumid. |
First of all THANK YOU so much for your time and effort helping me. I don't know much of anything about SQL queries. I tried your suggestion and got a timestamp error, so I changed the syntax of the date line, with the same error:
Code:
SELECT count(vb_post.postid) AS vb_postcount, vb_user.username HTML Code:
An error occurred while attempting to execute your query. The following information was returned. |
Quote:
|
That did it! Thanks to you both! This now works.
Code:
SELECT count(vb_post.postid) AS vb_postcount, vb_user.username |
All times are GMT. The time now is 03: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:
|