localhost mysql issue with EXISTS

心已入冬 提交于 2019-12-11 12:43:22

问题


it seems mysqlnd 5.0.11-dev bounded with XAMPP has issue with EXISTS . I'm trying to run this query:

  SELECT column1 FROM t1 WHERE EXISTS (SELECT * FROM t2);

but it doesn't run and output below errors:

Static analysis:

2 errors were found during analysis.

Unrecognized keyword. (near "EXISTS" at position 38) Unexpected token. (near "(" at position 45)

SQL query: Documentation

SELECT column1 FROM t1 WHERE EXISTS ( LIMIT 0, 25

MySQL said: Documentation 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

EDIT: issue resolved by wrapping EXISTS statement into () :

 SELECT column1 FROM t1 WHERE (EXISTS (SELECT * FROM t2));

but it is not indicated in official mysql documentaion is it only a documentation syntax error?

来源:https://stackoverflow.com/questions/35100281/localhost-mysql-issue-with-exists

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!