I have a table structure which looks similar to example below. Table1
Component Item
Screen Monitor
Monitor LED
Monitor LCD
Monitor CRT
Battery Vehicle
Vehicle Car
Car Green_Car
Car Red_Car
Red_Car A_Red_Car
Red_Car B_Red_Car
Red_Car C_Red_Car
Car Blue_Car
Blue_Car X_Blue_Car
Vehicle Van
Van 4D_Van
Van 6D_Van
6D_Van White_6D_Van
6D_Van Black_6D_Van
Van 8D_Van
Vehicle Bus
Bus HR_Bus
HR_Bus XL_HR_Bus
HR_Bus XXL_HR_Bus
Bus LR_Bus
LR_Bus White_LR_Bus
Vehicle Train
Train S_Train
Train L_Train
Train XL_Train
XL_Train F_XL_Train
Battery Toy
Toy Doll
Toy Robot
Robot Talking_Robot
Robot Walking_Robot
Robot FO_Robot
FO_Robot Red_FO_Robot
Red_FO_Robot M_Red_FO_Robot
Red_FO_Robot XXL_Red_FO_Robot
FO_Robot Yellow_FO_Robot
Yellow_FO_Robot M_Yellow_FO_Robot
Yellow_FO_Robot XL_Yellow_FO_Robot
Toy Teddy Bear
Teddy Bear Talking_Teddy Bear
Teddy Bear Walking_Teddy Bear
Battery Electrical Item
Electrical Item Radio
Electrical Item Remote Controller
Remote Controller TV
Remote Controller Audio
Remote Controller Box
Electrical Item Fan
Box Shoes
Box Computer
As seen there are multiple levels of record in this table. What I want to view is everything that has a battery as a component.
SELECT * FROM Table1 WHERE Component = 'Battery'
will give me everything that has 'Battery' directly as a Component. What I want is everything that's using a battery(Directly and indirectly) so all sub categories of the result set of above query basically.
For example, a Robot has a battery. also a XXL_Red_FO_Robot has a battery, so has All Yellow_FO_Robots but isn't directly visible in table.
Could someone advise please as to how to get this?