SqlServer如何用Sql语句自定义聚合函数 ?

我只要聚合函数,表值函数和标量函数就不要冒充了
我只要Sql语句创建聚合函数C#的 绕道

心有法竹
浏览 1239回答 2
2回答

梵蒂冈之花

有两个写法:   select * from tblDeptwhere id in(select DeptID from tblSalary group by DeptID having  count(case when Salary>3000 then 1 else null end)*1.0/count(*)>0.5)或select * from tblDeptwhere id in(select DeptID from tblSalary group by DeptID having  sum(case when Salary>3000 then 1 else 0 end)*1.0/count(*)>0.5)
打开App,查看更多内容
随时随地看视频慕课网APP