我有一个表包含字段ProcessName , StartDate和EndDate 。 我需要知道EndDate的标准偏差,以便知道我可以等待进程完成的时间限制。 根据此标准偏差,如果某个流程需要花费太多时间来运行,则会发送电子邮件。
我的想法是使用以下查询:
select ProcessName, STDEV(tm) from ( select ProcessName, cast(EndDate as decimal(18,6)) tm from Reports..ExecutionControl ) t1 group by ProcessName但是,首先我不知道它返回什么(如果它是百分比),也许这是缺乏统计理解,我也需要获得一个过程可以采取的时间限制,并且它不计算它。
有人可以帮我解决这个问题吗? 在此先感谢所有人!
I have a Table with fields ProcessName, StartDate and EndDate. I need to know the standard deviation of the EndDate in order to know the limit of time I can wait for a process to finish. Based on this standard deviation e-mails will be sent if some process is taking too much time to run.
My idea was to use the following query:
select ProcessName, STDEV(tm) from ( select ProcessName, cast(EndDate as decimal(18,6)) tm from Reports..ExecutionControl ) t1 group by ProcessNameBut, first I don't know what it returns (if it is percentage or not), and maybe this is a lack of statistical understanding, and also I need to get the time limit a process can take, and it is not calculating it.
Could someone help me to sort this out? Thanks in advance to all!
最满意答案
嗯,我不确定你如何在没有平均值的情况下使用标准偏差,但那是你的问题。
我希望这样的查询:
select ProcessName, STDEV(dateadiff(second, Startdate, Enddate)) as stdev_dur from Reports..ExecutionControl group by ProcessName;也就是说,标准偏差是根据持续时间而非EndDate计算的。
Hmmm, I'm not sure how you would use the standard deviation without an average, but that is your question.
I would expect a query like this:
select ProcessName, STDEV(dateadiff(second, Startdate, Enddate)) as stdev_dur from Reports..ExecutionControl group by ProcessName;That is, the standard deviation is calculated based on the duration, not EndDate.
更多推荐
发布评论