Originally posted by doodab
View Post

In the end, I used a standard XML function which can strip the record and reorder it, and then only selecting the first record for the loop.
Code:
XMLTable('string-join(for $i in ora:tokenize($str, ",") order by xs:integer($i) return $i, ",")'
passing t.path as "str"
columns sorted_str varchar2(4000) path '.'
Partition by the sorted string to get row_number() and use that.

Leave a comment: