diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-30 08:03:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-30 08:03:58 +0000 |
commit | 9f19773cebdc9476f2a3266d3c01c967c38fcd1e (patch) | |
tree | a60f607ba2bb64fb45da86c297ff29ffc9b92f58 /tests/fixtures/optimizer/qualify_columns.sql | |
parent | Releasing debian version 16.7.3-1. (diff) | |
download | sqlglot-9f19773cebdc9476f2a3266d3c01c967c38fcd1e.tar.xz sqlglot-9f19773cebdc9476f2a3266d3c01c967c38fcd1e.zip |
Merging upstream version 16.7.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/fixtures/optimizer/qualify_columns.sql | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/fixtures/optimizer/qualify_columns.sql b/tests/fixtures/optimizer/qualify_columns.sql index 81c0b5e..f7ece5b 100644 --- a/tests/fixtures/optimizer/qualify_columns.sql +++ b/tests/fixtures/optimizer/qualify_columns.sql @@ -87,6 +87,23 @@ SELECT x.a AS a, x.b AS b FROM x AS x GROUP BY x.a, x.b; SELECT a, b FROM x ORDER BY 1, 2; SELECT x.a AS a, x.b AS b FROM x AS x ORDER BY x.a, x.b; +SELECT 2 FROM x GROUP BY 1; +SELECT 2 AS "2" FROM x AS x GROUP BY 1; + +SELECT 'a' AS a FROM x GROUP BY 1; +SELECT 'a' AS a FROM x AS x GROUP BY 1; + +# execute: false +-- this query seems to be invalid in postgres and duckdb but valid in bigquery +SELECT 2 a FROM x GROUP BY 1 HAVING a > 1; +SELECT 2 AS a FROM x AS x GROUP BY 1 HAVING a > 1; + +SELECT 2 d FROM x GROUP BY d HAVING d > 1; +SELECT 2 AS d FROM x AS x GROUP BY 1 HAVING d > 1; + +SELECT 2 d FROM x GROUP BY 1 ORDER BY 1; +SELECT 2 AS d FROM x AS x GROUP BY 1 ORDER BY d; + # execute: false SELECT DATE(a), DATE(b) AS c FROM x GROUP BY 1, 2; SELECT DATE(x.a) AS _col_0, DATE(x.b) AS c FROM x AS x GROUP BY DATE(x.a), DATE(x.b); |