SQL Query to concatenate column values from multiple rows in Oracle

前端 未结 10 1227
鱼传尺愫
鱼传尺愫 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:20

    Try this code:

     SELECT XMLAGG(XMLELEMENT(E,fieldname||',')).EXTRACT('//text()') "FieldNames"
        FROM FIELD_MASTER
        WHERE FIELD_ID > 10 AND FIELD_AREA != 'NEBRASKA';
    

提交回复
热议问题