我需要根据同一张表中的不同过滤器查询json字符串
CASE
WHEN provider = 0 THEN JSON_VALUE_ARRAY (raw_data, '$.countries_served')
WHEN provider = 1 THEN JSON_VALUE (raw_data,
'$.MerchantCountryISOAlpha3')
WHEN provider = 2 THEN JSON_VALUE (raw_data, '$.operator.country.name')
WHEN provider = 3 THEN JSON_VALUE (raw_data,
'$.countryName')
WHEN provider = 4 THEN JSON_VALUE (raw_data, '$.countries')
此CASE
语句返回错误:
运营商 CASE 没有匹配的签名;所有 THEN/ELSE 参数都必须强制转换为通用类型,但可以找到:ARRAY、STRING;实际参数类型 (WHEN THEN) ELSE: (BOOL ARRAY) (BOOL STRING) (BOOL STRING) (BOOL STRING) (BOOL STRING) NULL at [6:3]
为什么会这样以及如何让它发挥作用?