By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE tablename (Emp varchar2(7), DateStarted date);
INSERT ALL
INTO tablename (Emp, DateStarted)
VALUES ('John', '01-Sep-2020')
INTO tablename (Emp, DateStarted)
VALUES ('Jane', '29-Sep-2019')
INTO tablename (Emp, DateStarted)
VALUES ('Adam', '28-Sep-2019')
INTO tablename (Emp, DateStarted)
VALUES ('Lauren', '30-Sep-2019')
INTO tablename (Emp, DateStarted)
VALUES ('Caleb', '30-Sep-2018')
INTO tablename (Emp, DateStarted)
VALUES ('Melanie', '27-Sep-2018')
INTO tablename (Emp, DateStarted)
VALUES ('Isaac', '30-Sep-2017')
SELECT * FROM dual
;
7 rows affected
-- '29-Sep-2020' instead of sysdate
DELETE FROM tablename
WHERE DateStarted < ADD_MONTHS('29-Sep-2020', -12)
AND DateStarted <> LAST_DAY(ADD_MONTHS('29-Sep-2020', -24))
3 rows affected
SELECT * FROM tablename
EMP | DATESTARTED |
---|---|
John | 01-SEP-20 |
Jane | 29-SEP-19 |
Lauren | 30-SEP-19 |
Caleb | 30-SEP-18 |