with test_table as (
select 1 id, to_date('19-02-2019', 'dd-mm-yyyy') from_dat, to_date('20-02-2019', 'dd-mm-yyyy') to_dat from dual union all
select 2 id, to_date('01-02-2019', 'dd-mm-yyyy') from_dat, to_date('20-03-2019', 'dd-mm-yyyy') to_dat from dual union all
select 3 id, to_date('14-02-2019', 'dd-mm-yyyy') from_dat, to_date('25-03-2019', 'dd-mm-yyyy') to_dat from dual union all
select 4 id, to_date('02-02-2019', 'dd-mm-yyyy') from_dat, to_date('22-03-2019', 'dd-mm-yyyy') to_dat from dual union all
select 5 id, to_date('14-02-2019', 'dd-mm-yyyy') from_dat, to_date('25-02-2019', 'dd-mm-yyyy') to_dat from dual
)
select id, from_dat, max(to_dat) from test_table
connect by nocycle
PRIOR to_dat > from_dat and
PRIOR from_dat < to_dat
group by id, from_dat
having max(to_dat) - from_dat > 30
order by id, from_dat