Search Postgresql Archives

argument of CASE/WHEN must not return a set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good morning,
 
I've have solved my problem in another way, but I am curious as to why I am getting the following error.
 
The following returns a boolean value a expected:
 
development=# SELECT LENGTH(ARRAY_TO_STRING(  REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+')
development(#                        , ',')
development(#                        )  =
development-#        LENGTH('12-70510')
development-#
development-#     AS "12-70510";
 12-70510
----------------
 f
(1 row)
 
But if I put the comparison into a CASE or WHERE clause I get this error:
 
development=# SELECT CASE
development-#             WHEN LENGTH(ARRAY_TO_STRING(  REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+')
development(#                                         , ',')
development(#                         )
development-#                  = LENGTH('12-70510')
development-#
development-#             THEN ARRAY_TO_STRING(  REGEXP_MATCHES('12-70510','^[0-9,0-9.0-9]+')
development(#                                  , ',')
development-#
development-#             ELSE ''
development-#         END AS "12-70510";
ERROR:  argument of CASE/WHEN must not return a set
LINE 2:             WHEN LENGTH(ARRAY_TO_STRING(  REGEXP_MATCHES('12...
 
 
What am I missing?
 
Thanks,
George

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux