在选择列表中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。 s
select CONVERT(datetime,(CONVERT(varchar(100),infoDataTime,23))) as infodatatime,YEAR(infodatatime) year,month(infodatatime) month,day(infodatatime) day,cast(avg(convert(float(18),Channel6)) as decimal(18,1)) Channel6
from T_VARTRIVER_10002053 where infoDataTime >= '2010-12-31' and infoDataTime <= '2015-12-31' group by
CONVERT(varchar(100),infodatatime,23),YEAR(infodatatime),month(infodatatime),day(infodatatime)
sql2000可执行
select CONVERT(datetime,1)) Channel6
from T_VARTRIVER_10002053 where infoDataTime >= '2010-12-31' and infoDataTime <= '2015-12-31' group by infoDataTime,day(infodatatime)