Oracle 使用 listagg 多列群組合成同一列方法
Contents
之前有在 MySQL 用過這個需求用過這個需求GROUP_CONCAT 和 CONCAT_WS 多個橫欄和縱欄組在一起方法 | 程式狂想筆記
但是 Oracle 用上有差異
還多了一堆限制(如:字數不能超過 4000)
distinct 還會被禁用??!
Distinct
- Oracle listagg去重distinct三種方法總結_weixiaohuai的博客-CSDN博客
- Remove Duplicates From Comma Separated String — oracle-tech
|
|
字數過長
|
|
但這個沒有排序…
逗號排序
Sort delimited separated values in a string with (Oracle) SQL - Stack Overflow
|
|
但這個跟 xmlagg 結合會有問題
都會跑出 null
先記錄到這邊