SQL中的标准差命令 [英] Standard deviation command in SQL

查看:857
本文介绍了SQL中的标准差命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#中从数据库中检索数据后,我必须实现标准差.

I have to implement standard deviation after retrieving data from the database in C#.

我必须从字段名称income中检索出一组值,其中性别为malefemale

I have to retrieve a set of values from the field name income where the gender is either male or female

有没有SQL命令可以直接计算标准差?还是应该使用C#分别计算?

Is there ay SQL command to directly calculate the standard deviation? or should I separately calculate it using C#?

推荐答案

尝试 STDEV 聚合函数:

Try the STDEV aggregate function:

select  gender
,       avg(value)
,       STDEV(value)
from    YourTable
group by
        gender

这篇关于SQL中的标准差命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆