comment on column SENREALTIMDATTAB.MONITORPOIDATID is '监测点数据ID'; comment on column SENREALTIMDATTAB.SENSORID is '传感器ID'; comment on column SENREALTIMDATTAB.CHECKTIME is '检测时间'; comment on column SENREALTIMDATTAB.CHECKVALUE is '检测值';
例如: select sensorid,sum(t.checkvalue)/count(t.sensorid)from SENREALTIMDATTAB where sensorid=66 and checktime> > to_date('2008-09-21 20:21:00','yyyy-mm-dd hh24:mi:ss')..
请相应的修改下,急需!!
最新回答
ら眼眸里的温柔
2025-02-24 11:50:16
--每隔15分钟求一个平均值 select sensorid,sum(t.checkvalue)/count(t.sensorid), TRUNC(((checktime-to_date('2008-09-21 20:21:00','yyyy-mm-dd hh24:mi:ss'))*24*60)/15 ,0)*15 from senrealtimdattab t where checktime > to_date('2008-09-21 20:21:00','yyyy-mm-dd hh24:mi:ss') and checktime <= to_date('2008-09-21 23:00:00','yyyy-mm-dd hh24:mi:ss') and t.sensorid in(66,67) group by TRUNC(((checktime-to_date('2008-09-21 20:21:00','yyyy-mm-dd hh24:mi:ss'))*24*60)/15 ,0)*15,sensorid order by sensorid