oralce group by字符串拼接

WMSYS.WM_CONCAT()  拼接字符串以逗號分隔spa

SQL> select * from idtable;.net

        ID NAME
---------- ------------------------------
        10 ab
        10 bc
        10 cd
        20 hi
        20 ij
        20 mncode

SQL> select id,wmsys.wm_concat(name) name from idtable
  2  group by id;orm

        ID NAME
---------- --------------------------------------------------------------------------------
        10 ab,bc,cd
        20 hi,ij,mnblog


select t1.projectid , WMSYS.WM_CONCAT(case when role = '0' then accountid end) over(order by projectid test1 ,WMSYS.WM_CONCAT(decode(t.role, '1', t.accountid)) test2 , WMSYS.WM_CONCAT(t.accountid) acc from PROJECTACCOUNT t, PROJECT t1 where t.projectid = t1.projectid group by t1.projectid 字符串


參考:http://blog.csdn.net/yy_mm_dd/article/details/3182953it

相關文章
相關標籤/搜索