Skip to Content
0
Former Member
Jan 18, 2016 at 09:10 AM

Drill Down in SQL:

34 Views

I have a data model, which represent a set of hierarchical nodes. I would like to kwno, if is possible to get the children of a node with a SQL query.

I try to explain with an example, with DB model. I have two tables: ZNODE (nodes master data) and ZRELATION (hierarchy).

ZNODE

ID TEXT 1 N1 2 N2 3 N1.1 4 N1.2 5 N2.1 6 N1.1.1

ZRELATION


PARENT ID 1 3 1 4 2 5 3 6

If I filter the query by node 1, I would get: N1.1, N1.2, N1.1.1 .


Can I do this with SQL?


Thanks!!


Carlos.