select data.stid,stinfo.stname,stinfo.sttype,rectime,surveytime,waterhead,ISNULL(waterLevel,0) AS waterLevel from data,stinfo where data.stid in(51) and data.stid=stinfo.stid And stinfo.WaterLevelSensor=1 and surveytime >='2008-11-4' and surveytime <='2008-12-5' and dtype='整点报文' order by surveytime
-->>
select data.stid,stinfo.stname,stinfo.sttype,rectime,surveytime,waterhead,ISNULL(waterLevel,0) AS waterLevel ,avg=avg(ISNULL(waterLevel,0))from data,stinfo where data.stid in(51) and data.stid=stinfo.stid And stinfo.WaterLevelSensor=1 and surveytime >='2008-11-4' and surveytime <='2008-12-5' and dtype='整点报文' order by surveytime这样?
-->>
select data.stid,stinfo.stname,stinfo.sttype,rectime,surveytime,waterhead,ISNULL(waterLevel,0) AS waterLevel ,avg=avg(ISNULL(waterLevel,0))from data,stinfo where data.stid in(51) and data.stid=stinfo.stid And stinfo.WaterLevelSensor=1 and surveytime >='2008-11-4' and surveytime <='2008-12-5' and dtype='整点报文' order by surveytime这样?
from data,stinfo
where data.stid in = 51 and data.stid=stinfo.stid And stinfo.WaterLevelSensor=1 and surveytime >='2008-11-4' and surveytime <='2008-12-5' and dtype='整点报文'
group by data.stid,stinfo.stname,stinfo.sttype,rectime,surveytime,waterhead
order by surveytime
from data,stinfo
where data.stid = 51 and data.stid=stinfo.stid And stinfo.WaterLevelSensor=1 and surveytime >='2008-11-4' and surveytime <='2008-12-5' and dtype='整点报文'
group by data.stid,stinfo.stname,stinfo.sttype,rectime,surveytime,waterhead
order by surveytime
我开始也用avg函数,但是group没有加这些报错!