2017-12-27 229 views
-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之间的不同。 第一次发布问题希望我没有错过任何东西。

+2

查询与错误信息 –

+0

不匹配mysql和mysqli执行相同的命令,所以它们之间没有区别。无论如何,从你的错误信息我可以清楚地看到,你没有发布你执行的完整的sql命令。请将执行的确切命令复制到这里,除非我们无法帮助。 – cramopy

+0

什么是您的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) –

回答

0

有一个known phpmyadmin bug无法处理与EXISTS查询。

请确保您安装了版本4.5.2或更高版本的phpmyadmin。

相关问题