You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing certain analytical queries it is useful to be able to refer to "grandparent" fields, for instance:
WITH myvalues
AS (
SELECT1AS a
)
SELECT (
SELECTsubquery1.aFROM (
SELECTa.bas a
FROM generate_series(1, 2) a(b)
WHEREa.b=myvalues.a
) subquery1
)
FROM myvalues;
This currently fails with:
UnsupportedFeatureException[Cannot use relation "myvalues" in this context. Can only access columns of an immediate parent, not a grandparent]
However in PostgreSQL it is accepted:
a
---
1
(1 row
Possible Solutions
Resolve field names like in PostgreSQL
Considered Alternatives
Depends on the situation, in some queries it is for instance possible to bring filtering one level up, into a CTE, using arrays, and then process them with array expressions at a single-row level.
The text was updated successfully, but these errors were encountered:
Problem Statement
When writing certain analytical queries it is useful to be able to refer to "grandparent" fields, for instance:
This currently fails with:
However in PostgreSQL it is accepted:
Possible Solutions
Resolve field names like in PostgreSQL
Considered Alternatives
Depends on the situation, in some queries it is for instance possible to bring filtering one level up, into a CTE, using arrays, and then process them with array expressions at a single-row level.
The text was updated successfully, but these errors were encountered: