1、用法
WMSYS.WM_CONCAT(要连接的字段)
该函数返回来自同一个分组的指定字段的非NULL值的连接起来字符串,默认逗号连接,一般搭配分组函数使用
2、示例
select XFJ_ID,RELATED_WORD from "PLATFORM"."TAB1010230" t where xfj_id='1492018952426098688';
以XFJ_ID分组,将RELATED_WORD 字段值 打印在一行,逗号分隔(默认)
select XFJ_ID,WMSYS.WM_CONCAT(RELATED_WORD) from "PLATFORM"."TAB1010230" t
where xfj_id='1492018952426098688' group by XFJ_ID;
去重
select XFJ_ID,WMSYS.WM_CONCAT(distinct RELATED_WORD) from "PLATFORM"."TAB1010230" t
where xfj_id='1492018952426098688' group by XFJ_ID;
亲测,达梦数据库也有这个函数,以上示例使用达梦数据库