生产同步给gitea
merge data 取 chpa 最大月 为R月
This commit is contained in:
@@ -48,22 +48,22 @@ from
|
||||
|
||||
create or replace temporary view merged_date_calender as
|
||||
WITH ALL_DATA_YYYY (
|
||||
select
|
||||
max(yyyymm) YYYYMM,
|
||||
'AIA' DATATYPE
|
||||
from
|
||||
dm.dm_tf_ext_unionall_sales
|
||||
where
|
||||
DATA_SOURCE = 'AIA(Monthly)'
|
||||
union all
|
||||
select
|
||||
max(yyyymm) YYYYMM,
|
||||
'DTP' DATATYPE
|
||||
from
|
||||
dm.dm_tf_ext_unionall_sales
|
||||
where
|
||||
DATA_SOURCE = 'DTP(Quarterly)'
|
||||
union all
|
||||
-- select
|
||||
-- max(yyyymm) YYYYMM,
|
||||
-- 'AIA' DATATYPE
|
||||
-- from
|
||||
-- dm.dm_tf_ext_unionall_sales
|
||||
-- where
|
||||
-- DATA_SOURCE = 'AIA(Monthly)'
|
||||
-- union all
|
||||
-- select
|
||||
-- max(yyyymm) YYYYMM,
|
||||
-- 'DTP' DATATYPE
|
||||
-- from
|
||||
-- dm.dm_tf_ext_unionall_sales
|
||||
-- where
|
||||
-- DATA_SOURCE = 'DTP(Quarterly)'
|
||||
-- union all
|
||||
select
|
||||
max(yyyymm) YYYYMM,
|
||||
'CHPA' DATATYPE
|
||||
@@ -379,4 +379,4 @@ insert overwrite dm.dm_td_external_calendar (
|
||||
external_sales_union
|
||||
)
|
||||
AND A.yyyymm <= (LEFT(D.YYYYMM, 4) * 100 + 12)
|
||||
AND A.day = 1
|
||||
AND A.day = 1
|
||||
|
||||
Reference in New Issue
Block a user