Jay Sprenkle wrote:


I believe rowid is assigned dynamically to the result set so it would
give a different
set of results for a different query.


Jay,

The rowid is the key from the btree used to store the table rows. It is not generated dynamically.

To get every N'th row after deletions you need some way to assign a series of integers to the result rows. The easiest way I can think of is to create a temporary table from your initial query. Then you can use the modulus operator to select every N'th record from that table as you have suggested since the rowids will all be freshly assigned. You will also need to drop the temp table when you are done with it.

 create temp table temp_table as select * from my_table where ....;
 select * from temp_table where rowid % N = 0;
 drop table temp_table;

HTH
Dennis Cote

Reply via email to