query to calculate the previous and next matchs IDs to be display in
the see bets page