query22.sql 741 B

12345678910111213141516171819202122
  1. -- start query 1 in stream 0 using template query22.tpl and seed 1819994127
  2. select i_product_name
  3. ,i_brand
  4. ,i_class
  5. ,i_category
  6. ,avg(inv_quantity_on_hand) qoh
  7. from inventory
  8. ,date_dim
  9. ,item
  10. ,warehouse
  11. where inv_date_sk=d_date_sk
  12. and inv_item_sk=i_item_sk
  13. and inv_warehouse_sk = w_warehouse_sk
  14. and d_month_seq between 1212 and 1212 + 11
  15. group by rollup(i_product_name
  16. ,i_brand
  17. ,i_class
  18. ,i_category)
  19. order by qoh, i_product_name, i_brand, i_class, i_category
  20. limit 100;
  21. -- end query 1 in stream 0 using template query22.tpl