I have two numeric ranges [1, 100] and [50, 200] :
1 100
50 200
- This is an intersection
Another case : with the ranges [40, 100] and [10, 200]
40 100
10 200
- This is an inclusion
How can I write an SQL query (or a PL:SQL procedure) that detects the inclusion / intersection.
I tried using minus but it doesn't work in all cases.
EDIT 1
The ranges are passed to the procedure as rows in a table.