SELECT * FROM table WHERE id=(SELECT id FROM table WHERE id>? ORDER BY id ASC LIMIT 1) OR id=(SELECT id FROM table WHERE id