The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL Query to select users who have NOT voted
Hi i am trying to write an SQL query that would select all users from a specific usergroup who have NOT voted in a specific poll:
Code:
SELECT vb3_user.* FROM vb3_user LEFT JOIN vb3_pollvote ON vb3_user.userid=vb3_pollvote.userid WHERE vb3_pollvote.userid IS NULL AND vb3_pollvote.pollid = 240 AND vb3_user.usergroupid =26 Luke Brown |
#2
|
|||
|
|||
WHERE vb3_pollvote.userid IS NULL
AND vb3_pollvote.pollid = 240 That will never be true. Either the userid is null (ie. no match) or the pollid has a value, never both at the same time. Try: [sql]SELECT vb3_user.* FROM vb3_user LEFT JOIN vb3_pollvote ON (vb3_user.userid=vb3_pollvote.userid AND vb3_pollvote.pollid = 24) WHERE vb3_pollvote.userid IS NULL AND vb3_user.usergroupid =26[/sql] |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|