项目中写hql语句 出现 ORA-01791: 不是 SELECTed 表达式问题。 语句如下: select distinct(name) where student order by number 这样就会报错。 原因是: SELECT语句中含有DISTINCT关键字或者有运算符时,排序用字段必须与SELECT语句中的字段相对应。 转载于:https://www.cnblogs.com/volare/p/3978909.html