Код: Выделить всё
SELECT v.ProductId, MAX(v.Price) AS Price
FROM Variant v
GROUP BY v.ProductId
ORDER BY Price ASC;
Код: Выделить всё
from item in
(from v in session.Query()
group v by v.ProductId into g
select new { Id = g.Key, Price = g.Max(x => x.Price) }
)
orderby item.Price
select new { Id = item.Id, Price = item.Price }
Код: Выделить всё
SELECT v.ProductId as col_0_0_, MAX(variantrec0_.Price) as col_1_0_
FROM Variant v
GROUP BY v.ProductId
ORDER BY MAX(v.Price) ASC
Код: Выделить всё
Expressions in the ORDER BY list cannot contain aggregate functions.
Как создать этот запрос с помощью NHibernate IQueryable?
Подробнее здесь: https://stackoverflow.com/questions/786 ... able-query