6

I need to perform the following select:

select c.address from Customer c where lower(trim(c.name)) = :name

But I get the following exception:

javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query

Any idea how can I combine trim with lower?

4

1 回答 1

13

我发现了解决方案,您必须使用both才能使语句起作用:

select c.address from Customer c where lower(trim(both from c.name)) = :name
于 2013-04-18T11:19:07.630 回答