q15.sql 740 B

1234567891011121314151617181920212223
  1. --!syntax_pg
  2. --TPC-DS Q15
  3. -- start query 1 in stream 0 using template ../query_templates/query15.tpl
  4. select ca_zip
  5. ,sum(cs_sales_price)
  6. from plato.catalog_sales
  7. ,plato.customer
  8. ,plato.customer_address
  9. ,plato.date_dim
  10. where cs_bill_customer_sk = c_customer_sk
  11. and c_current_addr_sk = ca_address_sk
  12. and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475',
  13. '85392', '85460', '80348', '81792')
  14. or ca_state in ('CA','WA','GA')
  15. or cs_sales_price > 500::numeric)
  16. and cs_sold_date_sk = d_date_sk
  17. and d_qoy = 2 and d_year = 2000
  18. group by ca_zip
  19. order by ca_zip
  20. limit 100;
  21. -- end query 1 in stream 0 using template ../query_templates/query15.tpl