Files
doris/regression-test/suites/with_clause_p0/sql/withExprUsingAnotherWithExpr.sql
2022-09-29 10:45:17 +08:00

7 lines
318 B
SQL

-- database: presto; groups: with_clause; tables: nation; queryType: SELECT
WITH w1 AS (select min(nationkey) as x , max(regionkey) as y from tpch_tiny_nation),
w2 AS (select x, y from w1)
select count(*) count, regionkey from tpch_tiny_nation group by regionkey
union all
(select * from w2) order by regionkey, count