aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/aggregate/aggregate_distinct_in_access_node_exprs.sql
blob: 0f0c3b68b3af45842f864d3eaa4bcb56a1aa1afe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
/* syntax version 1 */
/* postgres can not */
SELECT
    key,
    AGGREGATE_LIST(DISTINCT cast(subkey as Int32))[COUNT(DISTINCT cast(subkey as Uint64)) - 1] as foo
FROM
    AS_TABLE([<|key:1, subkey:"1"|>,
              <|key:2, subkey:"2"|>,
              <|key:1, subkey:"1"|>,
              <|key:2, subkey:"2"|>])
GROUP BY key
ORDER BY key;