aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/lineage/grouping_sets.sql
blob: 3bece901838d53901ed6162466f56d4c51b2beae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
USE plato;

$data = select
    key, subkey, value
from Input
group by GROUPING SETS (
    (key, subkey),
    (subkey, value)
    );

INSERT INTO @tmp WITH TRUNCATE
SELECT
    b.value
FROM $data AS a
LEFT JOIN Input AS b
USING (key)