snakeeyes1978
Programmer
Really lost here.. Here is my SQL statement:
SELECT count(*) FROM tblcomps_clans c, tblcomps_competitions comp WHERE c.clanid = '3' AND c.clanid + comp.competitionid <> ANY (SELECT clanid + competitionid FROM tblcomps_entries WHERE clanid = '3');
These fields exist in the database:
tblcomps.clanid
tblcompetitions.competitionid
tblentries.entryid
tblentries.clanid
tblentries.competitionid
What i'm trying to do is select the number of competitions the the clan has not entered into. I am lost to why this statement is coming back with errors. The error returned is:
MySQL said: Documentation
#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 '(SELECT clanid + competitionid FROM tblcomps_entries WHERE clan
The manual says:
The word SOME is an alias for ANY. Thus, these two statements are the same:
SELECT s1 FROM t1 WHERE s1 <> ANY (SELECT s1 FROM t2);
SELECT s1 FROM t1 WHERE s1 <> SOME (SELECT s1 FROM t2);
Any help here would be greatly appreciated.
SELECT count(*) FROM tblcomps_clans c, tblcomps_competitions comp WHERE c.clanid = '3' AND c.clanid + comp.competitionid <> ANY (SELECT clanid + competitionid FROM tblcomps_entries WHERE clanid = '3');
These fields exist in the database:
tblcomps.clanid
tblcompetitions.competitionid
tblentries.entryid
tblentries.clanid
tblentries.competitionid
What i'm trying to do is select the number of competitions the the clan has not entered into. I am lost to why this statement is coming back with errors. The error returned is:
MySQL said: Documentation
#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 '(SELECT clanid + competitionid FROM tblcomps_entries WHERE clan
The manual says:
The word SOME is an alias for ANY. Thus, these two statements are the same:
SELECT s1 FROM t1 WHERE s1 <> ANY (SELECT s1 FROM t2);
SELECT s1 FROM t1 WHERE s1 <> SOME (SELECT s1 FROM t2);
Any help here would be greatly appreciated.