In hql, you cannot write count (1) or count (. id. haiyisoft. vo. entity. cc. repo. businessStat (r. paramName, t. paramName, + (selectnvl (count (1), 0) + fromcom. haiyisoft. entity. cc. busi. businessb, com. haiyisoft. enti
In hql, you cannot write count (1) or count (. id) write the specific attribute 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
In hql, you cannot write count (1). You can write specific attributes in 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 ";
At the beginning, I wrote count (1) but never knew 1. I didn't care about it all the time. I thought I was wrong about other places, and finally changed count (1) to count (. id) Yes