Not sure if this is possible (or worth doing) in pure SQL, but I will ask anyway.
Let's say I have a record numbering in my database (extra spaces for clarity):
2 3 4 10 11 12 13 55 56 57 91 106 107
Now, given a number like "11", how can I get "10, 11, 12, 13"? those. all adjacent records without a gap (all numbers must be +/- 1 from each other).
Is it possible? If so, how?
source
share