UPDATE dmpsource.bas_asset_profile_j_new FROM (SELECT asset_row_id,Std_User_Type_Lvl2_Cd FROM BICVIEW_J.OFR_MAIN_ASSET_HIST_J
WHERE Start_Dt < CAST('20080901' AS DATE FORMAT 'YYYYMMDD')
AND End_Dt >= CAST('20080801' AS DATE FORMAT 'YYYYMMDD')
AND Std_Prd_Lvl4_Id BETWEEN 11010100 AND 11011099
AND Stat_Name <> '不活动'
QUALIFY ROW_NUMBER() OVER(PARTITION BY Asset_Row_Id ORDER BY Start_Dt DESC) = 1) abc
SET Std_User_Type_Cd=Std_User_Type_Lvl2_Cd
WHERE dmpsource.bas_asset_profile_j_new.asset_row_id=abc.asset_row_id
AND bill_month='200808'
阅读(2006) | 评论(0) | 转发(0) |