with EmpUpdate as (
select Employee.*,
row_number() over (partition by empId
order by SRNumber
) as seqnum
from Employee
)
update EmpUpdate
set EmpOrder =seqnum
where seqnum > 0;
select Employee.*,
row_number() over (partition by empId
order by SRNumber
) as seqnum
from Employee
)
update EmpUpdate
set EmpOrder =seqnum
where seqnum > 0;