Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
oracle sql如何组合列字符串值_Sql_Oracle - Fatal编程技术网

oracle sql如何组合列字符串值

oracle sql如何组合列字符串值,sql,oracle,Sql,Oracle,我有记录 id | key | string column ------------------------ 1 | 1 | A ------------------------ 1 | 1 | B ------------------------ 1 | 1 | C 我想要下面这样的结果 id | key | string column ------------------------ 1 | 1 | A, B, C ------------------------

我有记录

id | key | string column
------------------------
1  | 1   | A
------------------------
1  | 1   | B
------------------------
1  | 1   | C
我想要下面这样的结果

id | key | string column
------------------------
1  | 1   | A, B, C
------------------------
有人知道怎么做吗? 谢谢

您正在寻找:

select id, key, listagg(string, ', ') within group (order by string)
from t
group by id, key;