0
次のクエリ:postgres 9.4は、array_lengthがセットを返すと主張していますか?
select case when array_length(regexp_matches('sss', 's')::text[], 1) = 1 then 'x' else 'y' end;
はエラーを誘発:
ERROR: argument of CASE/WHEN must not return a set
LINE 1: select case when array_length(regexp_matches('sss', 's')::te...
^
********** Error **********
ERROR: argument of CASE/WHEN must not return a set
SQL state: 42804
Character: 18
私は何が起こっているのか思ったんだけど?このようなクエリを動作させるにはどうすればよいですか?
このクエリは正常に動作します:
select case when array_length('{1,2}'::text[], 1) = 1 then 'x' else 'y' end;