ok, here is my script link based on my understanding of the output you provided,
( mysql, ), , job , .
select t1.id
, t1.job_id
, t1.updatedate
, t2.rn as rnt2
from temprwithrn as t1
left
join temprwithrn as t2
on t1.rn = t2.rn + 1
where t1.job_id <> t2.job_id or t2.job_id is null