create or replace view CT_MRDS.VW_A_PROCESS_LOG as
select * from (
   select 
       l.a_process_log_key
      ,l.guid
      ,l.process_name
      ,l.procedure_name
      ,l.log_level
      ,l.log_message
      ,l.log_timestamp
      ,lead(log_message) over (partition by l.process_name, l.procedure_name, guid order by l.a_process_log_key) as next_log_message
      ,lead(log_timestamp) over (partition by l.process_name, l.procedure_name, guid order by l.a_process_log_key) as next_log_timestamp
   from CT_MRDS.a_process_log l
) where 1=1
  and log_message='Start'
order by log_timestamp
;