Grazie per le spiegazioni!
Let’s see if I’ve learned anything.
In general, since the join involves a lot of searches on the tables, it is better to sort the tables once and
for all and do the many searches using the sorting.
In this case I imagine to sort tbl1 by increasing ID and tbl2 by increasing ID1 and decreasing ID2 (how do you do it?), obtaining the following situation.
At this point the problem becomes to look for the green intervals.
Are standard techniques known for doing this research or is it a specific case that should be treated as such?
