q84.sql 814 B

123456789101112131415161718192021222324
  1. --!syntax_pg
  2. --TPC-DS Q84
  3. -- start query 1 in stream 0 using template ../query_templates/query84.tpl
  4. select c_customer_id as customer_id
  5. , coalesce(c_last_name,'') || ', ' || coalesce(c_first_name,'') as customername
  6. from plato.customer
  7. ,plato.customer_address
  8. ,plato.customer_demographics
  9. ,plato.household_demographics
  10. ,plato.income_band
  11. ,plato.store_returns
  12. where ca_city = 'Hopewell'
  13. and c_current_addr_sk = ca_address_sk
  14. and ib_lower_bound >= 32287
  15. and ib_upper_bound <= 32287 + 50000
  16. and ib_income_band_sk = hd_income_band_sk
  17. and cd_demo_sk = c_current_cdemo_sk
  18. and hd_demo_sk = c_current_hdemo_sk
  19. and sr_cdemo_sk = cd_demo_sk
  20. order by c_customer_id
  21. limit 100;
  22. -- end query 1 in stream 0 using template ../query_templates/query84.tpl