diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-19 11:01:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-12-19 11:01:55 +0000 |
commit | f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5 (patch) | |
tree | 5dce0fe2a11381761496eb973c20750f44db56d5 /tests/fixtures/optimizer/merge_subqueries.sql | |
parent | Releasing debian version 20.1.0-1. (diff) | |
download | sqlglot-f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5.tar.xz sqlglot-f1c2dbe3b17a0d5edffbb65b85b642d0bb2756c5.zip |
Merging upstream version 20.3.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/fixtures/optimizer/merge_subqueries.sql | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/merge_subqueries.sql b/tests/fixtures/optimizer/merge_subqueries.sql index eec8a73..7fc4b25 100644 --- a/tests/fixtures/optimizer/merge_subqueries.sql +++ b/tests/fixtures/optimizer/merge_subqueries.sql @@ -411,3 +411,20 @@ FROM ( ON _q_0.a = y.b ); SELECT y.b AS b FROM (x AS x JOIN y AS y ON x.a = y.b); + +# title: merge cte into subquery with overlapping alias +WITH q AS ( + SELECT + y.b AS a + FROM y AS y +) +SELECT + q.a AS a +FROM x AS q +WHERE + q.a IN ( + SELECT + q.a AS a + FROM q AS q + ); +SELECT q.a AS a FROM x AS q WHERE q.a IN (SELECT y.b AS a FROM y AS y);
\ No newline at end of file |