1.select base.var 第一次见这个写法;
FROM( SELECT p.datekey datekey, p.userid userid, c.clienttype FROM detail.usersequence_client c JOIN fact.orderpayment p ON p.orderid = c.orderid JOIN default.user du ON du.userid = p.userid WHERE p.datekey = 20131118 ) baseINSERT OVERWRITE TABLE `test`.`customer_kpi`SELECT base.datekey, base.clienttype, count(distinct base.userid) buyer_countGROUP BY base.datekey, base.clienttype