Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    Not true. cyberkiwi's solution using cte:s is pure sql without any vendor-specific hackery. Commented Jul 25, 2013 at 11:24
  • 1
    At the time of the question and answer, I would not have counted recursive CTEs as terribly portable, but they are supported now by Oracle. The best solution is going to depend upon the platform. For SQL Server it is most likely the FOR XML technique or a customer CLR aggregate. Commented Jul 25, 2013 at 15:11
  • 1
    the ultimate answer for all questions? stackoverflow.com/search?q=[whatever the question] Commented Dec 8, 2016 at 11:07