I have the following HQL query:
select c.device from Choice c
group by c.device
Now I want to count the number of groups in the result not the number of devices per group.
I tried:
select count(distinct c.device) from Choice c
group by c.device
but this give the number of distinct devices in each group. This is something like [2,3,4]
. But I need 2+3+4
.
How do I get the number of groups with HQL?