I am trying to select every nth row in SQL. I have been looking around Stack Overflow and piece together what I can based on my limited SQL knowledge. I have a table that has 81,225 rows. I am trying to select every 285th row in SQLite.
What I am using is as follows:
Select *
From Test A
Where ROWID > 0 AND ROWID <= 81225
AND ROWID % 285 = 285 % 285
This query is giving me 285 rows (which i would expect), but it's not giving me the expected results. Is there something that needs to be added/changed to this code to give me the desired results?
Thank you,