如何验证 SQL 中的数组列表是否为空

How to verify if array list is empty in SQL

我有一个返回值列表的多列表字段。

我的查询正在使用 IN (list) 过滤列表,但是如果用户没有 select 任何列表,它 returns 一个空列表,或者 null(我看不到).

我正在尝试做类似的事情:

    case when @list is null then 1
             when c.SK_dimLocalizacao in (@list) then 1
             else 0
        end = 1

当我 select none 或一个值时它有效,但如果我 select 多于一个它会给我带来错误。

我已经尝试使用:

    case when @list = '' then 1
             when c.SK_dimLocalizacao in (@list}) then 1
             else 0
        end = 1

我无法在后端修改查询,因为我正在使用 Pentaho。

也许是这个? (不确定我是否理解最终目标)

IF LEN(ISNULL(@list,'')) <> 0
BEGIN
   --Query for if the list isn't empty or null
END
ELSE
   --Query for if the list is empty or null