gpt4 book ai didi

jpql - 如何在JPQL中结合TRIM和LOWER函数?

转载 作者:行者123 更新时间:2023-12-04 17:10:37 24 4
gpt4 key购买 nike

我需要执行以下选择:

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

但是我得到以下异常:
javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query

知道如何将 trimlower结合吗?

最佳答案

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

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

关于jpql - 如何在JPQL中结合TRIM和LOWER函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16078666/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com