Mssql服务器执行休眠查询时遇到问题

时间:2018-11-23 08:21:34

标签: sql-server hibernate

当我运行Mssql服务器的休眠查询时,我遇到了问题

这是休眠查询:

select max(this_.created) as y0_,
       this_.who_entity as y1_,
       this_.what_entity as y2_,
       this_.who_id as y3_,
       this_.what_id as y4_,
       this_.action as y5_,
       this_.donotdisplay as y6_,
       this_.created as y7_
from Activity this_
where :Tenant_Security.current_tenant=this_.tenant_id
  and this_.deleted=0
  and (this_.donotdisplay is NULL
  and  this_.action is not null)
 GROUP by this_.created order by this_.created desc

我面临的错误是:

  

在选择列表中,'Activity.who_entity'列无效,因为它既不包含在聚合函数中也不在GROUP BY子句中。

以前,这在Mysql中有效,但是现在我试图在Mssql服务器中执行,此方法无法正常工作。有人可以帮助我吗?

谢谢。

0 个答案:

没有答案