I have a table based on numeric id's. Im trying to perform a select and then return the numeric range of the ids. For example if my select returned data that looked like:
+----------+--------------------+
| id | name |
+----------+--------------------+
| 1 | A |
| 2 | B |
| 3 | C |
| 4 | D |
| 5 | E |
|12 | F |
|13 | G |
|22 | H |
|23 | I |
The result I am looking for from this is:
1-5
12-13
22-23
Whether those are broken up as low and high or just have the dash is irrelevant. But an help in trying to find these ranges is appreciated.