Sql, Spl, Database.
select uid,1 as step1,min(etime) as t1 from event where etime>= to_date('2021–01–10') and etime<to_date('2021–01–25') and eventtype='eventtype1' and … group by 1), e2 as ( select uid,1 as step2,min(e1.t1) as t1,min(e2.etime) as t2 from event as e2 inner join e1 on e2.uid = e1.uid where e2.etime>=