Data Science, Analytics, Programming, Software Development, Sql.
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>= to_date('2021-01-10') and e2.etime<to_date('2021-01-25') and e2.etime > t1 and e2.etime < t1 + 7 and eventtype='eventtype2'