mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
10 lines
411 B
Plaintext
10 lines
411 B
Plaintext
select
|
|
cal_dt,
|
|
lctn_txt,
|
|
fe_asset_rfrnc_id,
|
|
nt_login,
|
|
max(csum_access_cnt) over (partition by lctn_txt,nt_login order by cal_dt,csum_access_cnt asc rows unbounded preceding ) as prev_cnt,
|
|
case when csum_access_cnt - coalesce(prev_cnt,0)<0 then csum_access_cnt
|
|
else csum_access_cnt - coalesce(prev_cnt,0) end as access_cnt
|
|
from ddm_data_assets_w.ds_tableau_rpt_usage_dtl_w
|
|
; |