I have a master table like this
Product Status Product id
A True 1
B True 2
C true 3
D True 4
E false 5
F True 6
Now I have other table which is giving me the dependency of the product
Product DependencyId
C 2
C 5
E 1
B 4
B 6
Now when I searching for C, I can see that two products are dependent upon C now these two product is dependent upon other products.
And let say I am searching for E, then I there are only one dependency of the product.
Now, I need to check for a product that if any dependency is false or not. If any of the dependency is false then I have to return some text/value.
Result
When product is C then output will be E (because the grand children of C (i.e. E) has false)
When product is B then output will be NULL (becuase none of the child of B or their sub childrens has false)
1 Answer