I have a version of MySQL MySQL on my server. I am trying to execute this query:
SELECT File_Name FROM Words_DB WHERE Word_Name=" . $element . " EXCEPT SELECT File_Name FROM Files_DB WHERE Display=0
I get an error message:
Error: you have an error in the SQL syntax; check the manual that matches your version of MySQL server for the correct syntax to use next to "EXCEPT SELECT File_Name FROM Files_DB WHERE Display = 0" on line 4
Can someone tell me how I can fulfill this request in an alternative form?
Thanks Max.
As far as I know, MySQL does not support the statement EXCEPT. Try instead:
EXCEPT
SELECT File_Name FROM Words_DB WHERE Word_Name=" . $element . " AND File_Name NOT IN ( SELECT File_Name FROM Files_DB WHERE Display=0 )
NOT EXISTS, LEFT JOIN. MySQL , , .
NOT EXISTS
LEFT JOIN
, : http://www.tutorialspoint.com/sql/sql-except-clause.htm
, . , JPW , , , NOT IN, .