aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/aggregate/compare_tuple.sql
blob: ca1b69e0713f5af858d5299b76991fd872d9cb7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* syntax version 1 */
/* postgres can not */
select
    key,
    min(AsTuple(subkey, value)) as min,
    max(AsTuple(subkey, value)) as max
from (
    select
        key,
        (case when length(subkey) != 0 then subkey else null end) as subkey,
        (case when length(value) != 0 then value else null end) as value
    from plato.Input
) group by key
order by key