1
0

query52.sql 571 B

12345678910111213141516171819202122
  1. -- start query 1 in stream 0 using template query52.tpl and seed 1819994127
  2. select dt.d_year
  3. ,item.i_brand_id brand_id
  4. ,item.i_brand brand
  5. ,sum(ss_ext_sales_price) ext_price
  6. from date_dim dt
  7. ,store_sales
  8. ,item
  9. where dt.d_date_sk = store_sales.ss_sold_date_sk
  10. and store_sales.ss_item_sk = item.i_item_sk
  11. and item.i_manager_id = 1
  12. and dt.d_moy=12
  13. and dt.d_year=2000
  14. group by dt.d_year
  15. ,item.i_brand
  16. ,item.i_brand_id
  17. order by dt.d_year
  18. ,ext_price desc
  19. ,brand_id
  20. limit 100 ;
  21. -- end query 1 in stream 0 using template query52.tpl