Anda mungkin ingin menggunakan LISTAGG
.
SELECT col_id,
LISTAGG(col_text, '|') WITHIN GROUP (ORDER BY col_text) text
FROM table1
GROUP BY col_id
Keluaran:
| COL_ID | TEXT |
----------------------------
| 111 | This|a|is|test. |
SQLFiddle
PERBARUI Jika Anda perlu mendapatkan nilai teks yang berbeda dalam daftar
SELECT col_id,
LISTAGG(col_text, '|')
WITHIN GROUP (ORDER BY col_text) text
FROM
(
SELECT DISTINCT col_id, col_text
FROM table1
)
GROUP BY col_id
SQLFiddle