Commit 5bd21149 by mengdongxing

Update tkdm_base_device_pay_info.sql

parent c79b442f
...@@ -14,7 +14,8 @@ select nvl(b.appid,a.appid) as appid, ...@@ -14,7 +14,8 @@ select nvl(b.appid,a.appid) as appid,
if(isnull(a.deviceid),'2017-02-24',nvl(b.last_payment_ds,'1970-01-01')) as last_payment_ds, if(isnull(a.deviceid),'2017-02-24',nvl(b.last_payment_ds,'1970-01-01')) as last_payment_ds,
nvl(b.num_payment_cnt,0)+nvl(a.num_payment_cnt,0) as num_payment_cnt, nvl(b.num_payment_cnt,0)+nvl(a.num_payment_cnt,0) as num_payment_cnt,
nvl(b.num_payment_day,0)+nvl(a.num_payment_day,0) as num_payment_day, nvl(b.num_payment_day,0)+nvl(a.num_payment_day,0) as num_payment_day,
round(nvl(b.amt_payment,0) + nvl(a.amt_payment,0),2) as amt_payment round(nvl(b.amt_payment,0) + nvl(a.amt_payment,0),2) as amt_payment,
nvl(a.is_new,0) as is_new_for_last_ds
from from
(select appid, (select appid,
deviceid, deviceid,
...@@ -55,7 +56,8 @@ first_payment_ds string, ...@@ -55,7 +56,8 @@ first_payment_ds string,
last_payment_ds string, last_payment_ds string,
num_payment_cnt int, num_payment_cnt int,
num_payment_day int, num_payment_day int,
amt_payment double amt_payment double,
is_new_for_last_ds int
) )
PARTITIONED BY (ds string) PARTITIONED BY (ds string)
clustered by (deviceid) sorted by(deviceid,appid) into 32 buckets clustered by (deviceid) sorted by(deviceid,appid) into 32 buckets
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment