Need help constructing SQL query [message #371928] |
Thu, 21 December 2000 15:49 |
alok
Messages: 12 Registered: December 2000
|
Junior Member |
|
|
In a tree stucture such as this
Root Node
|-- Node1--|Node1.1
|Node 1.2
|
|---Node2
Root Node (Node1 & Node 2 are children)
Node1 (Node1.1, Node 1.2 are children)
Node2 does not have children
How do I get all nodes under Root Node who don't have children of their own
i.e, in the above case with the root node it should return only Node2.
NODES TABLE
----------
NODE | PARENT_NODE <-- columns
~~~~~~~~~~~~~~~~~~~~~~~
Root Node NULL
Node1 Root Node
Node2 Root Node
Node1.1 Node1
Node1.2 Node1
Node2 NULL
|
|
|
|
|