I have two large tables of data in production
create table ter (acc varchar2(30), key number, year number );
create table ter1 (acc varchar2(30), key number, year number);
insert into ter values('1243', 000, 2018);
insert into ter1 values('1243', 001,2018);
insert into ter values('1244', 002,2018);
insert into ter1 values('1244', 002,2018);
insert into ter1 values('1245', 004,2018);
so if in ter the acc does not exist i want to delete for current fiscal year from ter1 .. I jus need to delete for current fiscal year
so this is what I tried
delete from ter1 a where not exist (select 1 from ter b where a.key = b.key and year =2018 )
is this the right way I am doing it ? I am not sure please help