localhost mysql issue with EXISTS

2019-08-14 13:47发布

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?

标签: mysql xampp
0条回答
登录 后发表回答