I have a tree structure of light bulbs. I want to turn on all the light bulbs starting from the leafs of the tree. A light bulb cannot be turned on unless all its immediate children are turned on.
The relation between the nodes in the tree structure is represented by table A:
Table B represents the nodes in the tree:
The state of table B represents the states true = on and false = off.
I would like to select all the light bulbs which are turned off AND has all immediate children turned on.
This is probably very simple, but I can't seem to get my head around it.