Is there a command for me to query my database in intervals?
For example
query id = 0, 2, 4, 6, 8....
sec query
query id = 1, 3, 5, 7...
| SitePoint Sponsor |

Is there a command for me to query my database in intervals?
For example
query id = 0, 2, 4, 6, 8....
sec query
query id = 1, 3, 5, 7...

if you want to do it based solely on the id column, yes. but if you have a gap, this will not give you a balanced set of results. for example, imagine the set of id's as follows: 1, 2, 3, 4, 5, 7, 8, 10, 11, 12. (notice 6 and 9 are missing)
queries in intervals of three would be
if you want an interval based on the returned rows, that's much more difficult.Code:select * from theTable where id div 3 = 1; results: 1, 4, 7, 10 select * from theTable where id div 3 = 2; results: 2, 5, 8, 11 select * from theTable where id div 3 = 3; results: 3, 12

that is what I am looking for, calling out the rows in interval of odds then even. reason why I used id column is because it is easy to call them out by that.

um... ok. so does my solution work for you?
Bookmarks