Files
MarketAnalysis-ETL/05 dm_td_external_exchangerate.sql
2026-04-27 11:04:09 +08:00

26 lines
609 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- Databricks notebook source
/*
修改日期20250311
修改人chenwu
修改内容取sales表中最大日期的年
*/
insert OVERWRITE dm.dm_td_external_exchangerate (
from_currency_id, to_currency_id, az_year, exchange_rate, etl_update_dt, etl_insert_dt
)
select
from_currency_id,
to_currency_id,
az_year,
exchange_rate,
etl_update_dt,
etl_insert_dt
from
dm.DM_TD_EXCHANGE_RATE
where
AZ_YEAR in (
select
left(max(YYYYMM), 4)
from
dm.dm_tf_ext_unionall_sales --取sales表中最大日期的年
)
AND FROM_CURRENCY_ID = 'USD'