listagg throw错误 - 字符串连接的结果太长

时间:2017-08-16 22:06:42

标签: oracle plsql

如果我们对多个firmware_version有相同的image_prerequisite,我使用下面的查询来连接firware_version。 它给我带来了错误

ORA - result of string concatenation is too long

SELECT device_count,
       dmc_id,
       CASE WHEN COUNT(image_prerequisite) OVER (PARTITION BY dmc_id, charging_group_id, image_prerequisite) > 1
       THEN listagg(firmware_version, '~') WITHIN GROUP (ORDER BY firmware_version) OVER (PARTITION BY dmc_id, charging_group_id, image_prerequisite)
        ELSE firmware_version
       END firmware_version,
       charging_group_id,
       image_prerequisite,
       count_within_dmcid
FROM   dm_temp_summing_dvc_by_fw

请建议其他一些方法来实现相同的功能。

提前致谢!

0 个答案:

没有答案