I have a query with NOT IN
. I've heard MySQL doesn't support NOT IN
, but I can't figure how to rewrite it.
My query is:
SELECT * FROM quests
WHERE id NOT IN ('" .$quest_completed. "')
AND location=" .$location_id. "
AND (follows=0 OR follows IN ('" .$quest_completed. "'))
ORDER BY title
eg:
SELECT * FROM quests
WHERE id NOT IN (6,21) AND
location=8 AND
(follows=0 OR follows IN (6,21))
ORDER BY title
Row id 6 is being returned in that when I specified WHERE id NOT IN 6