假设有一张表:
CUST_PROMO (customer_id,促销),用作客户收到的每个促销之间的映射。
select promotion, count(customer_id) as promo_size
from CUST_PROMO
group by promotion
这将为我们提供每次促销活动中的客户总数。
现在,我们有了CUSTOMER (customer_id,PROMO_RESPONDED,PROMO_PURCHASED),它列出了客户,哪些促销活动让客户做出了响应,哪些促销活动促使他们购买。
select PROMO_RESPONDED, count(customer_id