Skip to content

WHERE EXISTS ( ... subquery ...) not supported and error message is confusing #6852

@filimonov

Description

@filimonov

https://www.w3schools.com/sql/sql_exists.asp
ClickHouse doesn't support such a queries and thinks that 'exists' is a column name:

select * from system.one where exists (select 1);

Expected one of: LIKE, GLOBAL NOT IN, AS, IS, OR, QuestionMark, BETWEEN, NOT LIKE, AND, Comma, alias, IN, Dot, NOT, Arrow, token, NOT IN, GLOBAL IN

select * from system.one where exists;

Received exception from server (version 19.14.1):
Code: 47. DB::Exception: Received from localhost:9000. DB::Exception: Missing columns: 'exists' while processing query: 'SELECT dummy FROM system.one WHERE exists', required columns: 'dummy' 'exists', source columns: 'dummy'. 

0 rows in set. Elapsed: 0.011 sec. 

PS. Not important, issue is just to document that behaviour.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions