hibernate中利用原生SQL语言查询MySql数据库时,如何利用count()先进行一次统计,即在查询出的结果中会出现新的一列count(identifyImgid) 值
imgSetid |
count(identifyImgid) |
5 | 3 |
6 | 3 |
在对查询出的这个结果进行统计,如统计count(identifyImgid) =3的行数,新的count()命名为 c,下表即最终希望得到的结果
c |
2 |
完整的的SQL语句如下:
select count(*) as c from (select imgSetid,count(identifyImgid) fr