按Processname分组的标准偏差日期时间列(Standard Deviation over Datetime column grouped by Processname)

编程入门 行业动态 更新时间:2024-10-22 15:23:19
按Processname分组的标准偏差日期时间列(Standard Deviation over Datetime column grouped by Processname)

我有一个表包含字段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 ProcessName

But, 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.

更多推荐

本文发布于:2023-08-05 07:31:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1430218.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:偏差   日期   时间   标准   Processname

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!