记得有这样一个函数,将多行合并成一行,总是记不住。
wmsys.wm_concat(field)
SQL> select * from t1; ID NAME FID ----------- ------------------------------ ----------- 1 aaaa 0 2 bbbb 11 3 cccc 0 4 dddd 1 5 eeee 1 6 66666 2 7 7777 2 8 8888 3 9 9999 2 10 HHHHH 6 11 KKKKK 6 13 asdasfafsa 12 12 rows selected SQL> select fid,wmsys.wm_concat(name) as name_str from t1 group by fid; FID NAME_STR ----------- -------------------------------------------------------------------------------- 0 aaaa,cccc 1 dddd,eeee 2 66666,9999,7777 3 8888 6 HHHHH,KKKKK 11 bbbb 12 asdasfafsa 7 rows selected
Tag: Oracle