“处或附近的错误语法错误:”&引用;用于postgresql的spring boot中createNativeQuery的拆分部分()

“处或附近的错误语法错误:”&引用;用于postgresql的spring boot中createNativeQuery的拆分部分(),postgresql,spring-boot,placeholder,nativequery,Postgresql,Spring Boot,Placeholder,Nativequery,我在执行包含的查询时遇到SQL异常 split_part() method as split_part(value::TEXT,':', 1). 您的模糊处理层可能会阻塞:操作符。请改用cast()运算符: String queryStr = " select split_part(cast(value as text),':', 1) from table"; 但是你为什么认为你首先需要演员?如果您正在存储该列中的:字符,那么它很可能是text(或varchar)列,并且您根本不需要强制转

我在执行包含的查询时遇到SQL异常

split_part() method as split_part(value::TEXT,':', 1).

您的模糊处理层可能会阻塞
操作符。请改用
cast()
运算符:

String queryStr = " select split_part(cast(value as text),':', 1) from table";

但是你为什么认为你首先需要演员?如果您正在存储该列中的
字符,那么它很可能是
text
(或
varchar
)列,并且您根本不需要强制转换。

Hi@a_horse_,带有\u no\u名称-您是正确的,不需要强制转换为文本。我把它拆了,它很好用。谢谢。
ERROR 2020-02-10 14:54:37,926 [http-nio-7070-exec-1] 142 - ERROR: syntax error at or near ":"
  Position: 855 
String queryStr = " select split_part(cast(value as text),':', 1) from table";