I have a sql db2 code that get information on a existing data table and I want to modify it to not download the data starting from 2020-02-01, instead just update this table everyday. Please help me to modify this script not to retrieve the whole data over and over again just to update but keeps on updating only the new data everyday.
create table public.fc_TDPMean_By_DIM2_EtchDate as
select DIM2_EtchDate, Model, tool_id, avg(TDPower) as TDPower_Mean, count(slider_id)
from (select distinct a.slider_id, trunc(a.test_date_time), left(a.product_id,2) as Model, a.wafer_id, a.row_number,
a.column_number, a.x_coordinate, a.y_coordinate, a.error_code, a.grade, a.bin,
a.TFCTDPWR as TDPower, b.job_number, trunc(c.transaction_date_time) as DIM2_EtchDate, c.tool_id
from ah.param_jade_wide a left join ah.param_lap_summary b on a.wafer_id = b.wafer_id and a.row_number = b.row_number
left join ah.his_job c on c.job_number = b.job_number
where c.transaction_date_time > '2020-02-01'
and left(a.product_id,2) in ('L2','L3','L8','C3','C2','V8')
and b.source_system_code in ('MFG2.SLDR.LAPRUN')
and c.operation_id in ('545600')
and a.retest_number = 0
and a.class_description in ('PROD')
and not c.tool_id = 0 and not c.tool_id in ('') )
group by DIM2_EtchDate, Model, tool_id;
commit;
date(c.transaction_date_time) = some_previous_datecondition returns always the same data, disregarding on when you run it after thissome_previous_datedate? In other words, do you have any backdated updates to these tables?public.fc_TDPMean_By_DIM2_EtchDateis being created every day, I just want to get the data today and updated it to the tablepublic.fc_TDPMean_By_DIM2_EtchDate. I am newbie with db2 and I don't know how can I just updated it and not create the table everyday.