select
mem.routId,
mem.memCode,
r.routName,
r.ipaddress,
min(mem.usedValue) as minUsedValue,
max(mem.usedValue) as maxUsedValue,
avg(mem.usedValue) as avgUsedValue
from Net_Cap_Mem mem, Net_Routinfo r
where mem.routId=r.routId and recordTime>='2010-03-04 16:56:56' and recordTime<='2010-03-08 15:29:26'
and mem.routId in (select plan.goId from Net_Gatherpublicobject plan where plan.gmId=2) group by mem.routId order by avgUsedValue desc
上面是一个Mysql+Hibernate查询语句
最后我想用 字段 avg(mem.usedValue) as avgUsedValue 排序
问题:
我把这语句放入代码中执行就报错!说是找不到 avgUsedValue 这个字段
直接放入 数据库中可以正常查询到数据!
这是上面问题,应该怎么解决????
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货