query38.sql 1.0 KB

1234567891011121314151617181920212223
  1. -- start query 1 in stream 0 using template query38.tpl and seed 1819994127
  2. select count(*) from (
  3. select distinct c_last_name, c_first_name, d_date
  4. from store_sales, date_dim, customer
  5. where store_sales.ss_sold_date_sk = date_dim.d_date_sk
  6. and store_sales.ss_customer_sk = customer.c_customer_sk
  7. and d_month_seq between 1186 and 1186 + 11
  8. intersect
  9. select distinct c_last_name, c_first_name, d_date
  10. from catalog_sales, date_dim, customer
  11. where catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
  12. and catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
  13. and d_month_seq between 1186 and 1186 + 11
  14. intersect
  15. select distinct c_last_name, c_first_name, d_date
  16. from web_sales, date_dim, customer
  17. where web_sales.ws_sold_date_sk = date_dim.d_date_sk
  18. and web_sales.ws_bill_customer_sk = customer.c_customer_sk
  19. and d_month_seq between 1186 and 1186 + 11
  20. ) hot_cust
  21. limit 100;
  22. -- end query 1 in stream 0 using template query38.tpl