aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/window/win_peephole_double_usage.sql
blob: 3ace3346d6afcebc83648ab44e4a9693e7a07f8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* syntax version 1 */
/* postgres can not */

$input = select * from as_table([<|key:1|>, <|key:1|>]);

$src = select
   key,
   MIN(key) over w as curr_min
from $input
window w as (order by key);

select * from $src
union all
select * from $src;