Is it possible in mysql to find extremes values I have table with columns (timestamp, value) and I have to detect when values started to increased and decreased and notice that value.
I.e with this datas
2015-05-14 04:40:00, 1000
2015-05-14 05:20:00, 2000
2015-05-14 08:00:00, 2500
2015-05-14 08:20:00, 500
2015-05-14 09:10:00, 700
2015-05-14 10:20:00, 700
2015-05-14 11:40:00, 1300
2015-05-14 12:10:00, 1800
2015-05-14 12:40:00, 2700
2015-05-14 13:20:00, 3500
2015-05-14 14:10:00, 500
2015-05-14 14:30:00, 700
2015-05-14 14:50:00, 1000
I need to find 2015-05-14 08:00:00, 2500 as max and
2015-05-14 08:20:00, 500 as min and second point
2015-05-14 13:20:00, 3500 as max
2015-05-14 14:10:00, 500 as min
I want to find only extreme values so I need to find only rising and trailing edge.
Data are represented in that way http://fastwork.pl/karol/wykres_extrema.png