用 第二个参数连接数组元素,例: postgres=#selectarray_to_string (ARRAY[1,2,3],'##'); array_to_string---1##2##3(1row) postgres=# 结束
ARRAY_TO_STRING(ARRAY[column1, column2, column3],'')"asnew_column 将column1, column2, column3合并,通过空格相连,取别名new_column
TThe ARRAY_TO_STRING() function in PostgreSQL converts an array to a single string by concatenating its elements, using a specified delimiter. An optional parameter can be provided to replace null values in the array. Uses of the PostgreSQL ARRAY_TO_STRING() Function Concatenate Array Elements:...
该函数还可以搭配array_to_string函数将数组转合并成一个字符串: 1 2 select array_to_string(array_agg(distinct ref_no), '&') from cnt_item where updated_on between '2021-05-05' and '2021-05-30 16:13:25'; --合并结果:ITM2105-000001&ITM2105-000002&ITM2105-000003 分割字符串 string_to_...
PostgreSQL的 array_to_string 功能 开始 用 第二个参数连接数组元素,例: postgres=#selectarray_to_string (ARRAY[1,2,3],'##'); array_to_string---1##2##3(1row) postgres=# 结束
PostgreSQL的 array_to_string 功能,开始用第二个参数连接数组元素,例:postgres=#selectarray_to_string(ARRAY[1,2,3],'##');array_to_string---1##2##3(1row)postgres=#结束
1.1 string_agg函数 1.2 array_agg函数 2、窗口函数 2.1 窗口函数语法 2.2 avg()OVER() 2.3 row_number() 2.4 rank() 2.5 dense_rank() 2.6 lag() 2.7 first_value() 2.8 last_value() 2.9 nth_value() 2.10 窗口函数别名的使用 1、聚合函数 ...
解释: array(SELECT att.name FROM ay_tree_test2 att) 即把查询出来的name字段转化成array数组 array_to_string("数组","/") 即把数组转化为字符串,并用“/”连接(使用提供的分隔符连接数组元素)更加详细,请参考: http://www.cnblogs.com/stephen-liu74/archive/2012/05/07/229527...
array_to_string(c.conkey, ' ') ASconstraint_key, CASEconfupdtype WHEN'a'THEN'NO ACTION' WHEN'r'THEN'RESTRICT' WHEN'c'THEN'CASCADE' WHEN'n'THEN'SET NULL' WHEN'd'THEN'SET DEFAULT' ENDASon_update, CASEconfdeltype WHEN'a'THEN'NO ACTION' ...
如果给出了 null_string 且不为 NULL,则 NULL 数组项由该字符串表示;否则,它们将被省略。array_to_string ( array anyarray, delimiter text [, null_string text ] ) → text array_to_string(ARRAY[1, 2, 3, NULL, 5], ',', '*')→ 1,2,3,*,5...