如何在Oracle中返回类似于PostgreSQL的ARRAY_AGG
函数的数组?
SELECT
ARRAY_AGG(EMAIL)
FROM
EMPLOYEES
WHERE
EMAIL IS NOT NULL
AND
ORGANIZATION_ID IN (27623,27734)
答案 0 :(得分:1)
使用LISTAGG()
SELECT
LISTAGG(EMAIL) WITHIN GROUP (ORDER BY EMAIL) as email
FROM
EMPLOYEES
WHERE
EMAIL IS NOT NULL
AND
ORGANIZATION_ID IN (27623,27734)