您好,欢迎访问一九零五行业门户网

hql中不能写count(1)可以写count(a.id)

hql中不能写count(1)可以写count(a.id)里面写具体的属性 string hql=select new com.haiyisoft.vo.entity.cc.repo.businessstat( r.paramname ,t.paramname , + (select nvl(count(1),0) + from com.haiyisoft.entity.cc.busi.business b,com.haiyisoft.enti
hql中不能写count(1)可以写count(a.id)里面写具体的属性
string hql=select new com.haiyisoft.vo.entity.cc.repo.businessstat( r.paramname ,t.paramname ,
+ (select nvl(count(1),0)
+ from com.haiyisoft.entity.cc.busi.business b,com.haiyisoft.entity.cc.busi.application a,com.haiyisoft.entity.cc.busi.channel c
+ where b.applicationid=a.id and a.appchannel=c.id
+ and b.servtime>=to_date(' + bgtime + ','yyyy-mm-dd hh24:mi:ss')
+ and b.servtime+ and c.channelcode=r.paramcode and substr(b.busitype,0,2)=t.paramcode) as businum)
+ from
+ extendparamvalue r,
+ extendparamvalue t
+ where
+ r.dimension='cc_channel_code'
+ and t.dimension='cc_busi_type'
+ and length(t.paramcode)=2
+ order by r.paramcode,t.paramcode;
一开始写成count(1) 一直出不认识1,一直没在意,整了半天以为别的地方写错了,最后把count(1)变成count(a.id)可以了
其它类似信息

推荐信息