Skip to content

feat: scalar subquery and correlated subquery #3714

@aceforeverd

Description

@aceforeverd

ref https://github.com/google/zetasql/blob/master/docs/subqueries.md

Currently only table subquery is supported, while in many cases, subquery inside expression is necessary.
E.g.

SELECT mascot
FROM Mascots
WHERE
  NOT EXISTS(SELECT username FROM Players WHERE Mascots.team = Players.team);

or

SELECT id, agg_func(col1) over w from t1
window w as (
  partition by col2 order by ts
  rows between 
    (select max(col2) over w from t1 window w as(...)  ) preceding
    and current row
)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestexecute-enginehybridse sql enginehigh-prioritysqlSQL standard. definition/revise for a SQL statement/clause etc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions