SQL
Working with Recursive SQL Statements
Using recursive CTEs (common table expressions) can be useful when working with recursive or hierarchical data. Using a recursive CTE will allow us to fetch data using a single query, rather than needing to loop over and use several queries to build up the data as it comes in. Example