Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Getting Previous and Next records

872171Feb 4 2012 — edited Feb 6 2012
Hi ,

How can I get previous and next records from the table with reference to particular column value?

For ex.,

I have the following table with values

ID Title Country Locale
-------------------------------------
*1 A IND EN*
*2 B US EN*
*3 C RUS RU*
*4 D CAN CAN*
*5 E AUS EN*
*6 F UK EN*


Now how can I get Previous and Next row values of ID val = 4(If there is no previous records then it must take last row value and if there is no next record then it should take first value)?

Please help me, Thanks in advance.

Gowreeswaran C.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 5 2012
Added on Feb 4 2012
6 comments
788 views