的另一範圍內我有一個像下面比較值範圍內值MYSQL
id_indicator id_threshold activation_begin_value activation_end_value
1 121 1 2
1 122 3 4
1 123 5 6
1 124 6 7
2 125 10 9
2 126 8 7
2 127 6 5
2 128 5 4
表我怎麼能得到的細節,其中activation_begin_value和另一個閾值activation_end_value下跌。其中6個屬於id_threshold 123和124,與兩個id_threshold中的5個相同。查詢輸出如下:
id_indicator id_threshold activation_begin_value activation_end_value
1 123 5 6
1 124 6 7
2 127 6 5
2 128 5 4
請參閱http://meta.stackoverflow.com/questions/333952/why-should-i-provide-an-mcve-for-what-seems-to-me-to-be-a-very-simple -sql-query – Strawberry
我只想找出價值落入何處的thresold – Sumon
我引用你對我以前的評論。 – Strawberry