如何在MySQL中对以下日期进行分组

时间:2015-10-01 09:06:27

标签: mysql

我有排放数据的时间序列。我想选择某些高峰事件。 我所做的是计算一个门槛,并制作了一个超过时期的表格:

%create the treshold value
select min(dummie.value) from (select top 5 percent value from timevalues where id = 
(select id from source where type = 'observation') as dummie) as treshold

%view every time where the value is higher then treshold
select name, time, value from timevalue, catchment
where timevalue.sourceID = source.id 
and where source.id = catchment.sourceID
and where value >= treshold.value 
as exceed_table

现在我想要所有值超过此阈值的句点,然后计算它们的数量。有没有办法删除所有数据,它比之前的数据更进一步?

谢谢!

1 个答案:

答案 0 :(得分:0)

我通过复制beyond_table,向其添加一个步骤然后减去了beyond_table和复制的一个来解决它。