Select-List-Correlation with DISTINCT returns error

Details

Detail name Value
Changelog Number 12394
Type Bug
Status Open
Affected Versions Exasol 7.1.0, Exasol 7.0.3, Exasol 8.0.0, Exasol 8.29.0, Exasol 2025.1.0, Exasol 2025.2.0

Description

A query with a correlation in the select-list in combination with DISTINCT returns the error message 'Feature not supported: this kind of correlated subselect'.

Example

SELECT distinct
  t1.c12,
  (SELECT 1 FROM tab_corr S WHERE S.corr_col = t1.c11 and S.corr_filter = 'text' ) -- correlation in select-list
FROM t1;

Workaround

Move the DISTINCT to an outer select

SELECT distinct *
FROM
(
  SELECT
    t1.c12,
    (SELECT 1 FROM tab_corr S WHERE S.corr_col = t1.c11 and S.corr_filter = 'text' )
  FROM t1
);

Fix

The query works without exception.