]>
git.proxmox.com Git - ceph.git/blob - ceph/src/s3select/TPCDS/sample-queries-tpcds/query70.sql
1 -- start query 1 in stream 0 using template query70.tpl and seed 1819994127
3 sum(ss_net_profit
) as total_sum
6 ,grouping(s_state
)+grouping(s_county
) as lochierarchy
8 partition by grouping(s_state
)+grouping(s_county
),
9 case when grouping(s_county
) = 0 then s_state
end
10 order by sum(ss_net_profit
) desc) as rank_within_parent
16 d1.d_month_seq
between 1218 and 1218+11
17 and d1.d_date_sk
= ss_sold_date_sk
18 and s_store_sk
= ss_store_sk
21 from (select s_state
as s_state
,
22 rank() over ( partition by s_state
order by sum(ss_net_profit
) desc) as ranking
23 from store_sales
, store
, date_dim
24 where d_month_seq
between 1218 and 1218+11
25 and d_date_sk
= ss_sold_date_sk
26 and s_store_sk
= ss_store_sk
31 group by rollup(s_state
,s_county
)
34 ,case when lochierarchy
= 0 then s_state
end
38 -- end query 1 in stream 0 using template query70.tpl