【发布时间】:2018-06-08 05:15:45
【问题描述】:
我正在尝试检索没有与某个“huisnummer”(门牌号)相关的预订的所有房屋。
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 执行相同的命令,所以它们之间没有区别。无论如何,从您的错误消息中我可以清楚地看到,您没有发布您执行的完整 sql 命令。请复制您在此处执行的确切命令,除非我们无法提供帮助。
-
要测试这是否是 phpmyadmin 问题,请尝试从命令行 sql 运行查询。
-
@juergend
LIMIT 0, 25部分可能是 phpmyadmin 添加到原始查询中的。
标签: mysql phpmyadmin