query87.sql 1.0 KB

1234567891011121314151617181920212223
  1. -- start query 1 in stream 0 using template query87.tpl and seed 1819994127
  2. select count(*)
  3. from ((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 1221 and 1221+11)
  8. except
  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 1221 and 1221+11)
  14. except
  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 1221 and 1221+11)
  20. ) cool_cust
  21. ;
  22. -- end query 1 in stream 0 using template query87.tpl