Getting distinct values in a column in orm

五迷三道 提交于 2019-12-24 08:12:36

问题


I can pull data via

   <cfquery name="keyTypeGroup">
      SELECT DISTINCT keyTypeGroup
      FROM data.keyType
   </cfquery>

I can pull all the data via orm

...
return EntityLoad("data_KeyType");
...

I have tied

   <cfdump var="#ORMExecuteQuery('SELECT DISTINCT KeyGroupType FROM data.KeyType', true)#">

But I get

Error while executing the Hibernate query. 

org.hibernate.hql.ast.QuerySyntaxException: data.KeyType is not mapped [SELECT DISTINCT KeyGroupType FROM data.KeyType]

How should I approach fixing this?


回答1:


Try

<cfdump var="#ORMExecuteQuery('SELECT DISTINCT KeyGroupType FROM data.keyType', true)#">

I have seen issues with case in situations like this.



来源:https://stackoverflow.com/questions/21270202/getting-distinct-values-in-a-column-in-orm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!