merge into dim_oa_time using (select distinct to_date(date_num,'yyyy-mm-dd hh24:mi:ss') as date_num, is_rest from WORKTIME_SPECIALDAY where IS_REST =0) table2 on (dim_oa_time.fdate = table2.date_num) when matched then update set dim_oa_time.is_work = '1'