maybe something like the following will do:


create sequence xxx nocache;

insert into ttt (id,username, job,rank, sal)
select (xxx.nextval, user, 'salesperson',min(rank) over (partition by job ), min(sal) over (partition by job )
from ttt
where job = 'salesperson'