gpt4 book ai didi

java - JPQL 中 select 语句中的子字符串

转载 作者:行者123 更新时间:2023-11-30 09:52:30 24 4
gpt4 key购买 nike

我正在尝试选择列的substring,即select substring(description, 1, 200) from category where id=1

是否可以在 JPQL/JPA 2 的 select 语句中使用子字符串函数?如果是,如何?如果没有,是否有其他选择?谢谢。

最佳答案

有一个标量表达式:SUBSTRING(string, start, end)

我相信这在 JPA 2.0 的 SELECT 子句中是允许的,但在 JPA 1.0 中是不允许的。

关于java - JPQL 中 select 语句中的子字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4230826/

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