query28.sql 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. -- start query 1 in stream 0 using template query28.tpl and seed 444293455
  2. select *
  3. from (select avg(ss_list_price) B1_LP
  4. ,count(ss_list_price) B1_CNT
  5. ,count(distinct ss_list_price) B1_CNTD
  6. from store_sales
  7. where ss_quantity between 0 and 5
  8. and (ss_list_price between 11 and 11+10
  9. or ss_coupon_amt between 460 and 460+1000
  10. or ss_wholesale_cost between 14 and 14+20)) B1,
  11. (select avg(ss_list_price) B2_LP
  12. ,count(ss_list_price) B2_CNT
  13. ,count(distinct ss_list_price) B2_CNTD
  14. from store_sales
  15. where ss_quantity between 6 and 10
  16. and (ss_list_price between 91 and 91+10
  17. or ss_coupon_amt between 1430 and 1430+1000
  18. or ss_wholesale_cost between 32 and 32+20)) B2,
  19. (select avg(ss_list_price) B3_LP
  20. ,count(ss_list_price) B3_CNT
  21. ,count(distinct ss_list_price) B3_CNTD
  22. from store_sales
  23. where ss_quantity between 11 and 15
  24. and (ss_list_price between 66 and 66+10
  25. or ss_coupon_amt between 920 and 920+1000
  26. or ss_wholesale_cost between 4 and 4+20)) B3,
  27. (select avg(ss_list_price) B4_LP
  28. ,count(ss_list_price) B4_CNT
  29. ,count(distinct ss_list_price) B4_CNTD
  30. from store_sales
  31. where ss_quantity between 16 and 20
  32. and (ss_list_price between 142 and 142+10
  33. or ss_coupon_amt between 3054 and 3054+1000
  34. or ss_wholesale_cost between 80 and 80+20)) B4,
  35. (select avg(ss_list_price) B5_LP
  36. ,count(ss_list_price) B5_CNT
  37. ,count(distinct ss_list_price) B5_CNTD
  38. from store_sales
  39. where ss_quantity between 21 and 25
  40. and (ss_list_price between 135 and 135+10
  41. or ss_coupon_amt between 14180 and 14180+1000
  42. or ss_wholesale_cost between 38 and 38+20)) B5,
  43. (select avg(ss_list_price) B6_LP
  44. ,count(ss_list_price) B6_CNT
  45. ,count(distinct ss_list_price) B6_CNTD
  46. from store_sales
  47. where ss_quantity between 26 and 30
  48. and (ss_list_price between 28 and 28+10
  49. or ss_coupon_amt between 2513 and 2513+1000
  50. or ss_wholesale_cost between 42 and 42+20)) B6
  51. limit 100;
  52. -- end query 1 in stream 0 using template query28.tpl