-1
我試圖檢索所有沒有保留連接到某個「huisnummer」(housenumber)的房屋。爲什麼我的sql查詢返回關鍵字未找到
SELECT * FROM huis WHERE NOT EXISTS(select * FROM reservering WHERE reservering.huisnummer = huis.huisnummer)
,當我在我的本地主機的phpmyadmin執行的代碼我得到一個錯誤:
Keyword does not recognize. (near "not" at position 25)
Keyword does not recognize. (near "EXISTS" at position 29)
Unexpected token. (near "(" at position 35)
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'LIMIT 0, 25' at line 1
也許有mysql的&的mysqli之間的不同。 第一次發佈問題希望我沒有錯過任何東西。
查詢與錯誤信息 –
不匹配mysql和mysqli執行相同的命令,所以它們之間沒有區別。無論如何,從你的錯誤信息我可以清楚地看到,你沒有發佈你執行的完整的sql命令。請將執行的確切命令複製到這裏,除非我們無法幫助。 – cramopy
什麼是您的Phpmyadmin版本?有一個相關的[BUG](https://github.com/phpmyadmin/phpmyadmin/issues/11680)只能在phpMyAdmin 4.5.2上更正。相關問題:[鏈接](https://stackoverflow.com/questions/33690488/exists-subquery-causes-error-1064?rq=1)[Link2](https://stackoverflow.com/questions/36919209/not -exists-considered-as-a-syntax-error?rq = 1) –