我想返回整个实体以及一些聚合列。在SQL中我会使用内部选择,如下所示:
SELECT TOP 10 f.*, inner_query.[average xxx]
FROM (
SELECT f.Id, AVG(fb.xxx) AS [average xxx]
FROM foobar fb
INNER JOIN foo f ON f.FoobarId = fb.Id
) AS inner_query
INNER JOIN foo f ON f.Id = inner_query.Id
CreateCriteria可以实现吗?