方式一:
使用 || 进行拼接,略,此处不进行说明
方式二:
使用wmsys.wm_concat拼接函数进行拼接,如下所示
--合并字符串,默认使用逗号隔开
select (select to_char(wmsys.wm_concat((partofcheck))) from QUEUEDETAIL where appointsid='8a41a51e-6ea2-417f-b778-4ac420a25a4e') partofcheck_all from dual;
--可将拼接结果赋值给预先声明的变量如变量pAllCheckofpart:
select (select to_char(wmsys.wm_concat((partofcheck))) as partofcheck_all from QUEUEDETAIL where appointsid='8a41a51e-6ea2-417f-b778-4ac420a25a4e' ) into pAllCheckofpart from dual;
注:拼接默认以逗号隔开,可进行替换,替换方式如下:
replace(wmsys.wm_concat(partofcheck),',','、')
--合并字符串,默认使用 | 隔开
select (select to_char(replace(wmsys.wm_concat(partofcheck),',','|')) from QUEUEDETAIL where appointsid='8a41a51e-6ea2-417f-b778-4ac420a25a4e') partofcheck_all from dual;
--合并字符串,默认使用 、隔开
select (select to_char(replace(wmsys.wm_concat(partofcheck),',','、')) from QUEUEDETAIL where appointsid='8a41a51e-6ea2-417f-b778-4ac420a25a4e') partofcheck_all from dual;