我有一个查询NOT IN
。我听说 MySQL 不支持NOT IN
,但我不知道如何重写它。
我的查询是:
SELECT * FROM quests
WHERE id NOT IN ('" .$quest_completed. "')
AND location=" .$location_id. "
AND (follows=0 OR follows IN ('" .$quest_completed. "'))
ORDER BY title
例如:
SELECT * FROM quests
WHERE id NOT IN (6,21) AND
location=8 AND
(follows=0 OR follows IN (6,21))
ORDER BY title
当我指定时,正在返回第 6 行WHERE id NOT IN 6