I have a simple tree table in which I reference types, sub-types (no level limit), brands and models for a simple inventory application. data structure is as shown below: (nodeIsModel is a boolean …
Tag: hierarchical-data
Recursive CTE in Postgres
I have a table with the structure: And, for each employee, I need to show the top manager ID. I mean, if for example, I have the EmployeeID 2 whose manager is 3 and, therefore, the number 3 has the manager number 5, I would have to show: I need to do this with a Recursive CTE in Postgres. Answer
Returning all components multiple levels under a parent component
I have a hierarchical database out of which I would like to return all components in an asset with a specific common parent component. Components in table astComponents are linked to their parent …
Root level node is not coming in result
I am new to the Oracle Hierarchical Queries. I have one table and have the below data. Table Data Result Data My question is why parent id(100) is not included in the result? Below is the query. …