By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table t as
select 1 as id, 123 as value, 'oct' as month, 2020 as year from dual union all
select 1, 128, 'nov', 2020 from dual union all
select 1, 127, 'jan', 2021 from dual union all
select 2, 121, 'dec', 2020 from dual union all
select 2, 154, 'jan', 2021 from dual
5 rows affected
select t.*
from (select t.*,
lag(dte) over (partition by id order by dte) as prev_dte
from (select t.*,
to_date(year || '-' || month || '-01', 'YYYY-MON-DD') as dte
from t
) t
) t
where prev_dte <> dte - interval '1' month
ID | VALUE | MONTH | YEAR | DTE | PREV_DTE |
---|---|---|---|---|---|
1 | 127 | jan | 2021 | 01-JAN-21 | 01-NOV-20 |