SQLite Forum

Easy way to scroll through table
Login
Given a table with a bunch of rows in it. I am writing a windows program for displaying a row's data on a GUI form. I am trying to figure out a simple way to know the row-id of the next/previous row in the table when sorted by a Julian date column. The idea is to have a simple NEXT and PREVIOUS button on the screen to scroll through the rows showing the current row's data in the form window. Although the primary key is unique, rows were deleted and inserted after editing so the row-id when sorted on the Julian date column are not necessarily sequential, and gaps in the sequence exist due to deleting some rows. 

Is there a SQLite function or SQL command to determine the next/previous rowid when sorted on a column?

I am thinking doing a SELECT with a SORT and populate a temporary table with the row-id in the order they come out. However the database has several thousand rows and this seems an inefficient way of doing it.