I have a requirement where I need to sort out a data table with self referential relationship.
My Table looks something below as shown in the image. I want all the related subset records should be displayed under the parent record. Any Help?
Existing Table
|:------------------------------------------------------:| |Id....................|Color...........|.IsSubset?.....|..SubsetOf...|
|:------------------------------------------------------:|
|11111111.....|..Black..........| No................|...........................|
|234435..........|..Blue............| No.............. | ...........................|
|43657668.... |..Red............ | yes............. | 1111111111. |
|5767876....... |..Green....... | yes............. | 1111111111. |
|65876987.... | yellow........ | yes............. | 234435.......... |
|7697800....... | orange...... | yes............. | 234435.......... |
|:------------------------------------------------------:|
Expected table
|:------------------------------------------------------:| |Id....................|Color...........|.IsSubset?.....|..SubsetOf...|
|:------------------------------------------------------:|
|11111111.....|..Black..........| No................|...........................|
|43657668.... |..Red............ | yes............. | 1111111111. |
|5767876....... |..Green....... | yes............. | 1111111111. |
|234435..........|..Blue............| No.............. | ...........................|
|65876987.... | yellow........ | yes............. | 234435.......... |
|7697800....... | orange...... | yes............. | 234435.......... |
|:------------------------------------------------------:|