aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/pg/select_win_nth_value.sql
blob: 209a23405d74d79620c04ea6b7e1270ac49e480d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
--!syntax_pg
select
r,x,
nth_value(x,1) over w as nr1,
nth_value(x,2) over w as nr2,
nth_value(x,3) over w as nr3,
nth_value(x,4) over w as nr4
from (values (1,3),(2,null),(3,4),(4,5)) as a(r,x)
window w as (order by r)
order by r