Skip to content

Useful queries

dandanlen edited this page Jan 7, 2020 · 1 revision

The following examples use the gda_banking dataset from https://attack.aircloak.com/

SELECT 
    bucket(amount by 500),
    bucket(amount by 200),
    bucket(amount by 100),
    count(*),
    grouping_id(
        bucket(amount by 500),
        bucket(amount by 200),
        bucket(amount by 100)
    )
FROM 
    loans
GROUP BY GROUPING SETS (1,2,3)
Clone this wiki locally