[{"id":"840f0737-df1d-47ae-bb0a-359b01fe0608","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d5d9cdef-8854-4505-89be-a2bbc3cb4482","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3dc3dd55-35b0-4d23-bf62-47bc3650e4ee","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"80d84fbc-d0f8-4e4a-947f-e3e4de9b49b2","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"9152b7ca-0186-4fe3-a26f-5a05f322db07","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
        
(Showing Draft Content)

表值函数UnwindArray

UnwindArray 是系统中的另一个表值函数,用于将数组元素展开为数据行。

语法

UnwindArray ( arrayObject )

arrayObject 可以是命令参数表达式、公共函数 SPLITARRAY 返回的数组。

  • 公用函数 SPLIT 可以使用指定的定界符将字符串分割为多个段:

    SPLIT('hello,world',',')返回字符串数组:[“ hello”,“ world”]


  • 通用函数ARRAY可以根据函数参数构建对象数组:

    ARRAY(1,2,'hello')返回对象数组:[1,2,“ hello”]

数据架构

列索引

列名

数据类型

说明

0

Value

object

数组元素的值

UnwindArray 示例

示例一

select CINT(Value) as INT from UnwindArray(ARRAY(1,2,3)) tmp

结果表:

INT

1

2

3

示例二

select CSTR(Value) as STR from UnwindArray(SPLIT('hello+world','+')) tmp

结果表:

STR

hello

world