select *
from text_mining
where NOT EXISTS (select 1 from history
where text_mining.Noun = history.Noun
and text_mining.Adjective = history.Adjective)
谁能告诉我这有什么问题这是我的错误谢谢
无法识别的关键字。 (位置35处的“NOT”附近) 无法识别的关键字。 (位置39附近的“EXISTS”) 意外的标记。 (靠近“(”46号位置)
位置35表示关键词'NOT'和ÉXISTS'之间的空格;你的查询应该工作,尝试删除位置35的hiden字符;
SELECT t.*
FROM text_mining AS t
LEFT JOIN history AS h USING(Nown, Adjective)
WHERE h.id IS NULL
history
应该有任何一个INDEX(Noun, Adjective)
。
SELECT * FROM history a
WHERE !EXISTS
(SELECT 1 FROM text_mining b
WHERE a.Noun = b.Noun AND a.Adjective = b.Adjective)
使用!EXISTS
而不是NOT EXISTS