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

PRAGMA warning("disable", "4520");
PRAGMA DisableAnsiRankForNullableKeys;

SELECT
    key,
    RANK()                              over w1 as r1,
    DENSE_RANK()                        over w1 as r2,
FROM AS_TABLE([<|key:1|>, <|key:null|>, <|key:null|>, <|key:1|>, <|key:2|>])
WINDOW
    w1 as (ORDER BY key ROWS BETWEEN UNBOUNDED PRECEDING AND 5 PRECEDING)
ORDER BY key;