Du kan göra detta med row_number()
och själv gå med:
select e1.empid as empid_1, e2.empid as empid_2
from (select e.*, row_number() over (order by emp_id) as seqnum
from emp e
) e1 join
(select e.*, row_number() over (order by emp_id desc) as seqnum
from emp e
) e2
on e1.seqnum = e2.seqnum;
EDIT:
Du kan också göra detta med rownum
men det kräver ytterligare select
:
select e1.empid as empid_1, e2.empid as empid_2
from (select e.*, rownum as seqnum
from (select e.* from emp e order by empid asc) e
) e1 join
(select e.*, rownum as seqnum
from (select e.* from emp e order by empid desc) e
) e2
on e1.seqnum = e2.seqnum;