生产同步给gitea

merge data 取 chpa 最大月 为R月
This commit is contained in:
2026-05-18 06:51:16 +00:00
parent 414e2a8088
commit 7294cc1c6f
4 changed files with 2522 additions and 22 deletions

View File

@@ -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