select p.Id, sum(inc.Quantity)
from Products p join Incomes inc
group by p.Id
order by sum(inc.Quantity) >0
This query gives NHibernate.Hql.Ast.ANTLR.QuerySyntaxException on ORDER BY clause. I wonder is it possible to overcome this error and perform sorting by some expression?
UPDATE
I need to sort products list by name, price etc. BUT products with quantity == 0 must go to the bottom of the list (no matter what name, price it has). Also I need to perform paging of that list.