2011-01-31 55 views
0

可能重复:
Is there an Oracle SQL query that aggregates multiple rows into one row?
Agregate rows in Oracle SQL statement查询来获取列值逗号分隔

我与Oracle 10g的工作。我想从表中的一列中用逗号分隔字符串。

例如

Table : Customer   
Columns: id and name 

数据:

id-------name 

    1-------John 
    2-------Galt 
    3-------Howard 
    4-------Roark 

查询的输出应该乔恩,高尔特,霍华德,洛克

+0

我相信我的要求比您提到的线索中的问题简单得多。 – Sid 2011-01-31 22:14:16

+1

这里是另一个相关的问题:http://stackoverflow.com/questions/1788011/transpose-select-results-with-oracle(和最佳答案:http://www.sqlsnippets.com/en/topic-11591.html )。 – 2011-01-31 22:14:26

回答

1

好,我知道,我想要的是这样的:

SELECT WM_CONCAT(NAME) FROM CUSTOMER; 

将所有评论标记为+1。多谢你们。