Skip to Main Content

Listagg (reversed) for strings

Value
A
B
C
D
E
F
G

Listagg (reversed) for numbers

Value
1
2
3
4
5
6
7

Info

A SQL version of the apex_util.string_to_table PL/SQL function.

I needed a pure SQL version to create insert statements with; of course I could have used a PL/SQL procedure but this was a lot simpler. And it performs very well.
Change the : to whatever you need, and remove the distinct if needed.

Code

Region

Identification
Sequence
Title
Type
Source
Source Type
Region Source

Region

Identification
Sequence
Title
Type
Source
Source Type
Region Source