The issue is that you aren't asking a specific question with a well defined answer. Provide examples of your data and what you are trying to achieve for the best results in a forum like this.
On Monday, 17 July 2023, Greg Sabino Mullane <htamfids@gmail.com> wrote:
What exact problem are you trying to solve? Recursive CTEs return one row per internal invocation, so they already return a "set" of results, but you could use arrays or json if you wanted to pack in extra information per returned row.