So I have a table in mysql that has on it columns for a Minimum number and a maximum number.
| ID | MinNumber | MaxNumber |
| 1 | 2 | 4 |
| 2 | 3 | 7 |
| 3 | 10 | 12 |
I want to get a list of numbers that is included in all ranges.
So the list should look like: 2, 3, 4, 5, 6, 7, 10, 11, 12
Notice that 8 and 9 are missing because they are not within a range on the table.
Is there an easy way to get this range?
If it helps, I am trying to do this using PHP.
EDIT: This needs to run optimally. The real table has over 200,000 rows in it and the ranges can be hundreds apart. Any way to cut down on the processing time for this would help a lot!