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...