Re:The surprisingly difficult problem of user-defined order ...
by names_are_hard on Saturday January 16, 2021 @01:19AM
(#25800498)
All the answers on that page, except perhaps the Oracle one which uses a technique in not familiar with, are using recursion in CTEs
I seem to recall seeing _something_ more elegant than a linked list for this type of thing, but I don't recall what is what, offhand.