從MySQL數據庫拉動一些信息通過OPENQUERY:「不是在」查詢失敗
select *
from foo
where bar not in (select bar from foobar)
現在,如果我硬連線的數字替代子查詢,它工作正常,但我有接近1000個號碼,我需要排除。我一直沒有弄清楚這一點;兩個查詢都可以自行運行。錯誤總是告訴我,我在「從foobar的選擇吧)」的語法錯誤
感謝
編輯:
這裏是錯誤:
[MySQL][ODBC 3.51 Driver][mysqld-4.0.20-log]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 bar from foobar)' at line 3".
什麼是確切的錯誤? –
您可以顯示您正在使用的實際查詢,而不是用'foo'和'foobar'代替的實際查詢 – Jrod
該查詢設置沒有任何問題,除非您的非foo/barred字段是保留字。 –