Commit 351f1d7e by mengdongxing

Update tkdm_base_device_pay_info.sql

parent 46f74560
...@@ -15,7 +15,8 @@ select nvl(b.appid,a.appid) as appid, ...@@ -15,7 +15,8 @@ select nvl(b.appid,a.appid) as appid,
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,
coalesce(a.ins_datetime,b.ins_datetime,'1970-01-01') as ins_datetime coalesce(a.ins_datetime,b.ins_datetime,'1970-01-01') as ins_datetime,
nvl(a.amt_payment,0) as amt_payment_newest
from from
(select appid, (select appid,
deviceid, deviceid,
...@@ -47,6 +48,8 @@ cluster by deviceid ...@@ -47,6 +48,8 @@ cluster by deviceid
use tkdm; use tkdm;
...@@ -58,7 +61,8 @@ last_payment_ds string, ...@@ -58,7 +61,8 @@ 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,
ins_datetime string ins_datetime string,
amt_payment_newest double
) )
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