发布网友 发布时间:2022-04-14 17:54
共2个回答
懂视网 时间:2022-04-14 22:15
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<=to_date('" + edTime + "','yyyy-mm-dd HH24:mi:ss')"
+" 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";
热心网友 时间:2022-04-14 19:23
select a.examid ,b.examname,count(b.examname) as countsub from exams b inner join exam a on a.examid=b.examid group by a.examid,b.examname.可以用hibernate两种方式配置Exams和Exam实体类:1.配置文件2.注解