SQL语句转HQL语句,高手请进
吉普赛的歌 2010-08-26 08:59:10 表:ballotInfo
字段:id(bigint),teamName(varchar(50)),phone(varchar(20))
SQL语句:
select teamName,count(teamName),
count(teamName)/(select count(*) from ballotinfo)
from ballotInfo b group by teamName
要怎么转换成HQL语句呢?
String hql="select b.teamName,count(b.teamName)"+
",500*count(b.teamName)"+
",(select count(t2) from BallotInfo t2)"+
",500*count(b.teamName)/(select count(t3) from BallotInfo t3)"+ //加了这一句,立马报错,其它地方没有问题
" from BallotInfo b group by b.teamName order by count(b.teamName)";
小弟实在是没有分了, 先行谢过!