oracle12g不支持wm_concat解决办法

2019-11-14  本文已影响0人  猿择

使用listagg within代替wm_concat,例子如下:
原wm_concat:

select wmconcat(T.TABLE_NAME,',')   from user_tables  
t WHERE T.TABLE_NAME LIKE 'ST_TAB%' order by t.TABLE_NAME 

等价于如下SQL:

select listagg(T.TABLE_NAME,',') within group(order by t.TABLE_NAME) tables 
from user_tables  t WHERE T.TABLE_NAME LIKE 'ST_TAB%' 
上一篇下一篇

猜你喜欢

热点阅读