Expressions combining analytic functions and scalar subqueries cause errors

Details

Detail name Value
Changelog Number 26866
Type Bug
Status Resolved
Affected Versions Exasol 8.32.0, Exasol 2025.1.0
Fix Versions Exasol 2025.1.0, Exasol 2025.1.9, Exasol 2026.1.0
Resolution Date 2025-07-08

Description

It is possible that a valid and supported query throws “Feature not supported: this kind of correlated subselect", if the following conditions apply:

  • The query contains an expression with an analytic function.
  • The expression combines an analytic function with a scalar subquery.

Example:

CREATE OR REPLACE TABLE test.t1(a int);
INSERT INTO test.t1 values (1);
--Observed: Feature not supported: this kind of correlated subselect
--Expected: 2
SELECT (SELECT MAX(a) FROM Test.T1) + row_number() OVER();

Workaround

In many cases it is possible to use a join instead of a scalar subquery.

SELECT x + ROW_NUMBER() OVER() FROM DUAL, (SELECT MAX(a) FROM T1) as T(x);

Fix

The query works without throwing an error.