0
よりも大きくなければなりません:無効な長さ:フィールドの位置は、私はPostgresSQLの中に列を変換しようとしていますゼロ
ここcol_Aでいくつかの値されています
col_A
---------
John_arrived
Mary_Brown_arrived
J_C_Jr_arrived
Q_arrived
目的は、最初の部分を取得することで、 col_Aだけの最後の部分:
with t1 as (
select split_part(col_A, '_'::text, 1) || '_'
|| COALESCE (split_part(col_A, '_'::text, -1), '') as d_col_A
from my_table
)
select distinct d_col_A from t1
:ここ
d_col_A
-------
John_arrived
Mary_arrived
J_arrived
Q_arrived
は私のクエリです
Invalid Length
Detail:
-----------------------------------------------
error: Invalid Length
code: 8001
context: field position must be greater than zero
query: 2382655
location: funcs_string.cpp:1565
process: query0_27 [pid=11502]
-----------------------------------------------
私が間違って何をしたか任意のアイデア:
10は、それから私は、次のエラーを得ましたか。ありがとう!