我这个是统计满足条件的数据平均值,主要是WHERE 后面的部分,closed 列有1、0、和NULL。当为1时,不进行计算。CLOSED <>1 时少了为NULL部分数据,CLOSED is null 时少了为0部分的数据,
WHERE (POINTID = 'YBPer1_tBlrMnStm_H.S') AND DUTYID = 3 AND CLOSED <>1 or CLOSED is null AND DAY(ETIME)>=" + ($P3 - 10) + " AND DAY(ETIME)<" + $P3, 1)
(POINTID = 'YBPer1_tBlrMnStm_H.S') 为测点名,DUTYID为班组号,DAY(ETIME)>=" + ($P3 - 10) + " AND DAY(ETIME)<" + $P3, 1)为日期范围,