Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Q]SQL Question
select t2.dep
, t2.emp
, t2.salary - t1.salary as difference
from tab t1, tab t2
where t2.rownr % 2= 1 -- even rownumbers
and t2.rownr = t1.rownr + 1
This is assuming that you have no "holes" in the numbering, and that the relevant employees always comes in pairs.
Kristian
Ng K C Paul wrote:
> How can I select the result after I add a rownumber or identity to the table?
>
> <snip>:
Received on Fri Oct 02 1998 - 00:00:00 CDT