问题
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