I have a HQL query:
select max(l.Num) from SomeTable l group by l.Type, l.Iteration
How can I translate/convert it to QueryOver?
Following one:
var grouped = session.QueryOver<SomeTable>()
.SelectList(l => l
.SelectGroup(x => x.Type)
.SelectGroup(x => x.Iteration)
.SelectMax(x => x.Num));
will generate SQL:
SELECT
MAX(l.Num),
l.Type,
l.Iteration
FROM
SomeTable l
GROUP BY
l.Type,
l.Iteration
which is not what I expect – I don’t want to have Type and Iteration in Select.
I'm using that query as subquery for select z from c where z IN (subquery)
.