aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/aggregate/compare_by_nulls.sql
blob: 7f481549230fa88ab737a55c57eb383b60d7f9f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* syntax version 1 */
/* postgres can not */
use plato;

$src = select null as key, value from Input;
$src_opt = select null as key, Just(value) as value from Input;
$src_null = select null as key, null as value from Input;


select min_by(value, key) from $src;
select max_by(value, key) from $src_opt;
select min_by(value, key) from $src_null;

select max_by(value, key) from (select * from $src limit 0);
select min_by(value, key) from (select * from $src_opt limit 0);
select max_by(value, key) from (select * from $src_null limit 0);


select min_by(value, key) from (select Nothing(String?) as key, value from Input);