Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> SQL to show window around selected records
I'd like to display records both preceding and following a record in an Oracle
9i database.
Given a table named EVENTS with the following layout:
Name Null? Type
order by logsequence;
gets the center record.
'LogSequence' is a monotonically increasing number.
Can this be done in a single SQL statement? Examples would be appreciated.
Thanks! Received on Wed Feb 19 2003 - 13:08:34 CST
![]() |
![]() |