cizao

oracle 10g以上 一个wm_concat函数
行转列

SQL> select wm_concat(name) from test;
WM_CONCAT(NAME)

-------------------------------------------------------------------------

a,b,c,d,e

把结果里的逗号替换成"|"


SQL> select replace(wm_concat(name),\',\',\'|\') from test;

REPLACE(WM_CONCAT(NAME),\',\',\'|\')

-----------------------------------------------------------------------

a|b|c|d|e

按ID分组合并name

SQL> select id,wm_concat(name) name from test group by id;

ID NAME

---------- ------------------------------

1 a,b,c

2 d,e

分类:

技术点:

相关文章:

  • 2021-10-26
  • 2021-08-02
  • 2022-12-23
  • 2022-03-13
  • 2021-05-24
  • 2021-08-21
猜你喜欢
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案