Vuoi trovare gruppi consecutivi di righe simili e quindi aggregazione. Mi piace la differenza di approccio dei numeri di riga:
select name, act, min(startt) as startt, max(endd) as endd
from (select i.*,
row_number() over (partition by name, act order by rn) as seqnum_na,
row_number() over (partition by name order by rn) as seqnum_n
from input i
) i
group by (seqnum_n - seqnum_na), name, act;
Puoi vedere come funziona osservando cosa fa la sottoquery.