]> git.proxmox.com Git - ceph.git/blob - ceph/src/s3select/TPCDS/sample-queries-tpcds/query76.sql
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / s3select / TPCDS / sample-queries-tpcds / query76.sql
1 -- start query 1 in stream 0 using template query76.tpl and seed 2031708268
2 select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
3 SELECT 'store' as channel, 'ss_customer_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price
4 FROM store_sales, item, date_dim
5 WHERE ss_customer_sk IS NULL
6 AND ss_sold_date_sk=d_date_sk
7 AND ss_item_sk=i_item_sk
8 UNION ALL
9 SELECT 'web' as channel, 'ws_ship_addr_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price
10 FROM web_sales, item, date_dim
11 WHERE ws_ship_addr_sk IS NULL
12 AND ws_sold_date_sk=d_date_sk
13 AND ws_item_sk=i_item_sk
14 UNION ALL
15 SELECT 'catalog' as channel, 'cs_ship_mode_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price
16 FROM catalog_sales, item, date_dim
17 WHERE cs_ship_mode_sk IS NULL
18 AND cs_sold_date_sk=d_date_sk
19 AND cs_item_sk=i_item_sk) foo
20 GROUP BY channel, col_name, d_year, d_qoy, i_category
21 ORDER BY channel, col_name, d_year, d_qoy, i_category
22 limit 100;
23
24 -- end query 1 in stream 0 using template query76.tpl