需要帮助使用nhibernate queryover编写使用max和group的查询

时间:2013-07-18 17:18:35

标签: sql nhibernate group-by fluent-nhibernate-mapping queryover

我是nhibernate的新手,我没有找到如何使用queryover api执行此sql查询:

SELECT category, MAX(number) as "Highest number"
FROM table1
GROUP BY category;

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

尝试改变这个:

SELECT department, MAX(number) as "Highest number" FROM table1 GROUP BY category;

到此:

SELECT department, MAX(number) as "Highest number" FROM table1 GROUP BY department;