SQL Query to concatenate column values from multiple rows in Oracle

前端 未结 10 1235
鱼传尺愫
鱼传尺愫 2020-11-21 07:12

Would it be possible to construct SQL to concatenate column values from multiple rows?

The following is an example:

Table A

PID
A
B
C

10条回答
  •  野性不改
    2020-11-21 07:24

    The LISTAGG analytic function was introduced in Oracle 11g Release 2, making it very easy to aggregate strings. If you are using 11g Release 2 you should use this function for string aggregation. Please refer below url for more information about string concatenation.

    http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php

    String Concatenation

提交回复
热议问题