为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】: DM Database Server 64 V8, DB Version: 0x7000d,03134284368-20250430-272000-20149,Msg Version: 43,Gsu level(5) cnt: 0
【操作系统】:centos7
【CPU】:
【问题描述】*:
SELECT t.dept_id, LISTAGG(DISTINCT t.qd, ',' ON OVERFLOW TRUNCATE '...') AS qd_name, count(t.qd) AS qd_count FROM biz_service_pzgxqd t WHERE t.dept_id is not null and t.user_id IS NULL GROUP BY t.dept_id 将group_concat更换成LISTAGG查询正常,拼接的列最长287个字符,总行数308行,数据量很小。
问题是我查另一张表左关联这个子查询就报告[-6102]:数据溢出
select t1.dept_id as deptId from sys_dept t1 LEFT JOIN (SELECT t.dept_id, LISTAGG( DISTINCT t.qd, ',' ON OVERFLOW TRUNCATE '...') AS qd_name, count(t.qd) AS qd_count FROM biz_service_pzgxqd t WHERE t.dept_id is not null and t.user_id IS NULL GROUP BY t.dept_id) t2 ON t1.dept_id = t2.dept_id
最好能给一个能重现的简单的例子
你好,我这边环境8.1.4.116版本无此问题。
换listagg2试试
