aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/aggregate/group_by_gs_flatten.sql
blob: 0ee762b98541e35a1c103e5964bef31a11f6f7e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
/* syntax version 1 */
/* postgres can not */
use plato;

$input = select a.*, [1,2] as lst from Input as a;

select key, subkey, some(lst) as lst_count
from $input flatten list by lst
where lst != 1
group by grouping sets ((key), (key, subkey))
order by key, subkey;