listagg数据库链接问题

时间:2018-05-16 10:31:13

标签: oracle plsql dblink listagg ora-00923

对于以下查询,我只收到错误:

  

ORA-00923:在DBLINK中找不到FROM关键字。

select LISTAGG(SERVICE_ORDER, ', ')  WITHIN GROUP (ORDER BY SERVICE_ORDER) 
"service_order"
FROM TBL_DATA@TBL_REP

1 个答案:

答案 0 :(得分:0)

也适用于12c(12.1.0.2.0):

SELECT LISTAGG (SERVICE_ORDER, ', ') WITHIN GROUP (ORDER BY SERVICE_ORDER)
           "service_order"
  FROM (SELECT 'a' SERVICE_ORDER FROM DUAL
        UNION ALL
        SELECT 'b' SERVICE_ORDER FROM DUAL
        UNION ALL
        SELECT 'c' SERVICE_ORDER FROM DUAL)