v.21.11New Features

Support EXISTS (subquery) in ClickHouse

Support EXISTS (subquery). Closes #6852. #29731 (Kseniia Sumarokova).
Support for EXISTS (subquery) has been added to ClickHouse, allowing the use of EXISTS clauses in SQL queries.

Why it matters

This feature enables users to write more expressive and efficient queries by checking the existence of rows returned by a subquery. It solves the limitation of not being able to use the EXISTS predicate, which is common in standard SQL for conditional filtering based on related data presence.

How to use it

Users can now include EXISTS (subquery) in their SQL queries directly. For example:

SELECT *
FROM table1
WHERE EXISTS (SELECT 1 FROM table2 WHERE table2.id = table1.id)