The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL query questions
The goal ... find how many users used "man" in their biography field in their profile. Then to change their usergroupid (I can do that much once I understand why the following SELECT query is wrong).
I've been messing around with this query ... but I'm still not familiar enough with JOIN statements to understand why it keeps throwing a syntax error. #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LEFT JOIN user AS user ON (userfield.userid = user.userid) AND usergroupid = 2 A' at line 2 Query Code:
SELECT * FROM userfield WHERE field1 = 'man' LEFT JOIN user AS user ON (userfield.userid = user.userid) AND usergroupid = 2 AND posts = 0 I'm using phpmyadmin and have the delimiter ; in the delimiter box hence it not being in the query above. |
#2
|
||||
|
||||
Quote:
Code:
SELECT * FROM userfield LEFT JOIN user AS user ON (userfield.userid = user.userid) WHERE field1 = 'man' AND usergroupid = 2 AND posts = 0 |
2 благодарности(ей) от: | ||
John Lester, Lynne |
#3
|
|||
|
|||
Thank you Squid
It makes sense now that I see it done properly |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|