Snowflake Vs MS-SQL - Part 115 - Recursive View - Hierarchy


Recursive View - Hierarchy

Sometimes data is stored in a hierarchical structure within a table. To display the complete lineage or parent-child relationship, you can use a recursive query.

MS-SQL Server

We can achieve it by creating a CTE as follows:



In Snowflake, we can use a similar approach as above; however, we can make use of a Recursive View as follows:




For more details, refer to the Recursive_View section.


Yogesh Shinde

Comments

Popular posts from this blog

Snowflake Vs MS-SQL - Series

Snowflake Key Concepts

Snowflake Vs MS-SQL - Part 46 - RATIO_TO_REPORT