Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: oracle rownum
odelya wrote:
>
> Tha sort is not by the ID - it's by another parameter in the table
> (date..)
>
Maybe Analytic Functions can help:
select * from (
SELECT some_table.*, lead(ID) over (order by date) as LEAD_ID, lag(id)
over (order by date) as LAG_ID
from some_table
) some_table_plus
where ID = :search_id
or LEAD_ID = :search_id
or LAG_ID = :search_id
order by date
br,
Martin
Received on Tue Aug 21 2007 - 11:34:48 CDT
![]() |
![]() |