【发布时间】:2017-07-26 12:38:35
【问题描述】:
我有一个包含三列的表(名为“游戏”):天气、体育和客户
weather sports customer
sun volleyball Randy
sun volleyball Lau
sun gym Ryan
sun gym Rachel
表格
weather sports customer
sun volleyball Randy, Lau
sun gym Ryan, Rachel
我使用了以下 LISTAGG 命令,但它给了我错误提示“不是按表达式分组”
SELECT
weather, sports,
LISTAGG(customer, ',') WITHIN GROUP (ORDER BY sports) "Customer"
FROM games
GROUP BY customer;
【问题讨论】: