2015-10-01 44 views
0

我有一系列排放數據時間序列。我想選擇某些高峯事件。 我所做的就是計算treshold,並提出與超過時間的表:如何在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 

現在我想所有的值是這個treshold以上,再算上他們有多少人的時間。有沒有辦法刪除所有的數據?

謝謝!

回答

0

我解決了這個問題,通過複製exceed_table,添加一個時間步,然後減去exceed_table和複製的。

相關問題