hogeというカラムには1,2,3,4,5,6のような値が入っています。
データを分割したかったので下記のクエリを作成したのですが、エラーが返ってきてしまいました。
sql
1select 2 regexp_split_to_array(hoge,',') 3from fuga 4 5# エラー内容 6-- SQLエラー [42883]: ERROR: function regexp_split_to_array(text, "unknown") does not exist 7-- ヒント: No function matches the given name and argument types. You may need to add explicit type casts.
型が一致しないエラーと理解し、下記のように書き換えましたが、やはりエラーが返ってきてしまいます。
sql
1select 2 regexp_split_to_array(hoge,','::varchar) 3from fuga 4 5# エラー内容 6-- SQLエラー [42883]: ERROR: function regexp_split_to_array(character varying, character varying) does not exist 7-- ヒント: No function matches the given name and argument types. You may need to add explicit type casts.
この場合はどうすればよいでしょうか?
回答2件
あなたの回答
tips
プレビュー