oracle WMSYS.WM_CONCAT 函数转为listagg
诸位大神,请帮忙把下面这个sql中的WMSYS.WM_CONCAT函数转为listaggSELECTr.*,(SELECTg.group_nameFROMmon_evt_...
诸位大神,请帮忙把下面这个sql中的 WMSYS.WM_CONCAT 函数转为listagg
SELECT r.*,
(SELECT g.group_name
FROM mon_evt_rule_group g
WHERE g.id = r.rule_group_id)
AS rule_group_name,
(SELECT TO_CHAR (WMSYS.WM_CONCAT (s.name))
FROM mon_evt_selector s
WHERE INSTR (r.selector_relations, '''' || s.id || '''') > 0)
AS selector_name,
(SELECT u.user_name
FROM mon_sys_user u
WHERE u.it_code = r.create_person_id)
AS create_person_name
FROM mon_evt_rule r
WHERE 1 = 1
ORDER BY r.RULE_GROUP_ID DESC
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "WMSYS.WM_CONCAT_IMPL", line 30
现在报这个错,我在网上搜说是可以用listagg替换WMSYS.WM_CONCAT,我自己写了几个都不行,还请各位大神帮忙啊 展开
SELECT r.*,
(SELECT g.group_name
FROM mon_evt_rule_group g
WHERE g.id = r.rule_group_id)
AS rule_group_name,
(SELECT TO_CHAR (WMSYS.WM_CONCAT (s.name))
FROM mon_evt_selector s
WHERE INSTR (r.selector_relations, '''' || s.id || '''') > 0)
AS selector_name,
(SELECT u.user_name
FROM mon_sys_user u
WHERE u.it_code = r.create_person_id)
AS create_person_name
FROM mon_evt_rule r
WHERE 1 = 1
ORDER BY r.RULE_GROUP_ID DESC
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "WMSYS.WM_CONCAT_IMPL", line 30
现在报这个错,我在网上搜说是可以用listagg替换WMSYS.WM_CONCAT,我自己写了几个都不行,还请各位大神帮忙啊 展开
展开全部
NVL2(expr1,expr2,expr3) 功能:如果参数表达式expr1值为NULL,则NVL2()函数返回参数表达式expr3的值;如果参数表达式expr1值不为NULL,则NVL2()函数返回参数表达式expr2的值。NVL( string1, replace_with) 功能:如果string1为NULL,则NVL函数返回replace_with的值,否则返回string1的值,如果两个参数都为NULL ,则返回NULL。
追问
你写的这是什么啊?
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询