|
| 1 | +{% include 'header.sql.jinja' %} |
| 2 | + |
| 3 | +-- NB: Subquerys |
| 4 | +-- start query 1 in stream 0 using template query28.tpl and seed 444293455 |
| 5 | +select * |
| 6 | +from (select avg(ss_list_price) B1_LP |
| 7 | + ,count(ss_list_price) B1_CNT |
| 8 | + ,count(distinct ss_list_price) B1_CNTD |
| 9 | + from {{store_sales}} as store_sales |
| 10 | + where ss_quantity between 0 and 5 |
| 11 | + and (ss_list_price between 73 and 73+10 |
| 12 | + or ss_coupon_amt between 7826 and 7826+1000 |
| 13 | + or ss_wholesale_cost between 70 and 70+20)) B1 cross join |
| 14 | + (select avg(ss_list_price) B2_LP |
| 15 | + ,count(ss_list_price) B2_CNT |
| 16 | + ,count(distinct ss_list_price) B2_CNTD |
| 17 | + from {{store_sales}} as store_sales |
| 18 | + where ss_quantity between 6 and 10 |
| 19 | + and (ss_list_price between 152 and 152+10 |
| 20 | + or ss_coupon_amt between 2196 and 2196+1000 |
| 21 | + or ss_wholesale_cost between 56 and 56+20)) B2 cross join |
| 22 | + (select avg(ss_list_price) B3_LP |
| 23 | + ,count(ss_list_price) B3_CNT |
| 24 | + ,count(distinct ss_list_price) B3_CNTD |
| 25 | + from {{store_sales}} as store_sales |
| 26 | + where ss_quantity between 11 and 15 |
| 27 | + and (ss_list_price between 53 and 53+10 |
| 28 | + or ss_coupon_amt between 3430 and 3430+1000 |
| 29 | + or ss_wholesale_cost between 13 and 13+20)) B3 cross join |
| 30 | + (select avg(ss_list_price) B4_LP |
| 31 | + ,count(ss_list_price) B4_CNT |
| 32 | + ,count(distinct ss_list_price) B4_CNTD |
| 33 | + from {{store_sales}} as store_sales |
| 34 | + where ss_quantity between 16 and 20 |
| 35 | + and (ss_list_price between 182 and 182+10 |
| 36 | + or ss_coupon_amt between 3262 and 3262+1000 |
| 37 | + or ss_wholesale_cost between 20 and 20+20)) B4 cross join |
| 38 | + (select avg(ss_list_price) B5_LP |
| 39 | + ,count(ss_list_price) B5_CNT |
| 40 | + ,count(distinct ss_list_price) B5_CNTD |
| 41 | + from {{store_sales}} as store_sales |
| 42 | + where ss_quantity between 21 and 25 |
| 43 | + and (ss_list_price between 85 and 85+10 |
| 44 | + or ss_coupon_amt between 3310 and 3310+1000 |
| 45 | + or ss_wholesale_cost between 37 and 37+20)) B5 cross join |
| 46 | + (select avg(ss_list_price) B6_LP |
| 47 | + ,count(ss_list_price) B6_CNT |
| 48 | + ,count(distinct ss_list_price) B6_CNTD |
| 49 | + from {{store_sales}} as store_sales |
| 50 | + where ss_quantity between 26 and 30 |
| 51 | + and (ss_list_price between 180 and 180+10 |
| 52 | + or ss_coupon_amt between 12592 and 12592+1000 |
| 53 | + or ss_wholesale_cost between 22 and 22+20)) B6 |
| 54 | +limit 100; |
| 55 | + |
| 56 | +-- end query 1 in stream 0 using template query28.tpl |
0 commit comments