I have a table (shrewd_db.threshold) in MySQL database where I have executed following code
select id_indicator, id_threshold, activation_begin_value, activation_end_value
from shrewd_db.threshold
where active =1
group by id_indicator, id_threshold;
My output is as follows:
id_indicator id_threshold activation_begin_value activation_end_value
2 5 4 58
2 6 3 3
2 7 1 2
2 8 0 0
4 13 0 4.5
4 15 4.1 5.5
4 16 5.51 6
4 17 6.01 100
Each id_indicator has four range of id_threshold.
Now for a data validation check I need to find out each indicator id_threshold (activation_begin_value and activation_end_value) not fall into another threshold.
My desired output should be like:
id_indicator id_threshold activation_begin_value activation_end_value
4 13 0 4.5
4 15 4.1 5.5
where id_indicator (4) two id_threshold(13,15) values falls each other. Mainly identify threshold must not overlap
where id_indicator (4) two id_threshold(13,15) values falls each other=> This doesn't make sense to. Can you elaborate why do you need only these 2 rows in output and not any other rows?