sql语句为:
表:d_contents
字段:id,userNum
A:SELECt
count(case when d.id<=1 and d.userNum= 100002 THEN 1 else null end)
,count(case when d.userNum= 100002 THEN 1 else null end)
from d_contents d
A语句为sql语法,在HQL中该语句如何编写?
分不多求个帮助
sql语句为:
表:d_contents
字段:id,userNum
A:SELECt
count(case when d.id<=1 and d.userNum= 100002 THEN 1 else null end)
,count(case when d.userNum= 100002 THEN 1 else null end)
from d_contents d
A语句为sql语法,在HQL中该语句如何编写?
分不多求个帮助
String hql="from Class where d.id<=1 and d.userNum= 100002 THEN 1 else null end "
List case=session.createQuery(hql).list();
int count=case.size();
我想到的就是大体这个样子了,