alternative to listagg in Oracle?

后端 未结 6 1242
孤独总比滥情好
孤独总比滥情好 2020-12-14 20:00

listagg is a function introduced in Oracle 11.2! now this function is bugging us allot, we are migrating from MySQL to Oracle and we have this query:

SELECT
         


        
6条回答
  •  有刺的猬
    2020-12-14 20:29

    You can solve the ORA-22814 error by using MULTISET instead of COLLECT:

    SELECT
        p_id,
        MAX(registered) AS registered,
        listaggclob(cast(multiset(
            select MESSAGE
            from umm_parent_id_remarks_v
            where umm_parent_id_remarks_v.p_id = m.p_id
        ) as clob_t)) MESSAGE
      FROM
        umm_parent_id_remarks_v m
      GROUP BY
        m.p_id;
    

提交回复
热议问题