sql - 计算每天 Ms-Sql 总行中的最大连续行
解决方案
我认为你想要条件聚合:
select todaydate, count(*) as totalrow,
sum(case when (numb > 2 and calibration <> 1) then 1 else 0 end) as [max]
from table t
group by todaydate;
推荐阅读
- c - 想不出错误
- c - 通过 NAT 发送和接收 UDP 数据包
- javascript - Complex Grouping : Array Reduce
- javascript - 如何在 JavaScript 中向结构化数组添加更多元素?
- javascript - 如何获得提取变量的智能感知?
- javascript - 无法在 javascript 中为 adobe acrobat 更改文本字体
- c# - Microsoft Graph - 使用块上传的 SharePoint 文档上传丢失 HttpContext
- go - foo.go + foo_test.go 的任何有用替代品
- r - 如何将矩阵第 i 列中的所有元素提升到 i 次方?
- android - 我需要将 AdMob 广告单元 ID 保存在安全的地方吗?