当前位置:网站首页>PostgreSQL array type, each splice

PostgreSQL array type, each splice

2022-07-07 13:38:00 Xiaodou whole sugar (Cx)

If there is such case

Field test_array_concat yes array type , The data are as follows

{
   2022,2023}

Now I want to change it to

{
   2022.xml,2023.xml}

It can be as follows

 update test set  test_array_concat=(select array(select unnest(test_array_concat)||'1.xml' from test  where id=294662523385290759)) where voucher_id=294662523385290759;

among
unnest Will array Expand into rows , After splicing, it is converted into array that will do

原网站

版权声明
本文为[Xiaodou whole sugar (Cx)]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071136193761.html