v.25.4Experimental Feature

Support correlated subqueries as an argument

Support correlated subqueries as an argument of EXISTS expression in the WHERE clause. Closes #72459. #76078 (Dmitry Novik).
Support for correlated subqueries within the EXISTS expression in the WHERE clause.

Why it matters

This feature allows users to write more expressive and powerful queries by enabling the use of correlated subqueries as arguments to the EXISTS predicate. It solves the limitation where only uncorrelated subqueries were previously supported with EXISTS, thus expanding the flexibility and capability of conditional filtering in queries.

How to use it

Users can now include correlated subqueries inside the EXISTS expression in the WHERE clause as usual. For example:

SELECT *
FROM table1 t1
WHERE EXISTS (
SELECT 1
FROM table2 t2
WHERE t2.some_column = t1.some_column
);