一.数组合并的两种方法 1.concat--合并数组,并且不去重 var arr1 = ["ab","bc","de","fg"]; var arr2 = ["ml","kg","ww","bc","am"]; var arr3 = arr1.concat(arr2);console.log(arr3) 2.自定义数组合并并去重
用到Oralce10g以后增加的函数wmsys.wm_concat 例如这张表的有两个字段,要按airport_id合并成两行可用sql语句 select airport_id, wmsys.wm_concat( account) from AIRPORT_MODIFY group by airport_id 结果为: 非常简单,美中不足的是合并结果没有排序,解决排序问题最简单的办法就是在合并列前加上distinct 此外,如果合并列结果出现乱码,需要在合并列前加上to_char(),如wm