q52.sql 634 B

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