Skip to content
Advertisement

how to sort recursive query in PostgreSQL

I have sql query to find all replies from orig comment:

How can I sort it to have it like this?

Advertisement

Answer

Maintain the path and sort:

Here is a db<>fiddle.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement