I have two tables like this:
ID | Parent_Question_ID | AnswerID
Then another table:
ID | AnswerID | Sub_Question_ID
In here Parent_Question_ID
and Sub_Question_ID
are all Question_ID
s. and AnswerID
s are also the same.
The relationship is that a "ParentQuestion" will have 1 or more answers and answers will have one more "SubQuestion"s, which can again have 1 or more answers and so on. If a "SubQuestion" has answers it will be stored as a Parent_Question_ID
with Answer_ID
in table 1.
I want to write a method to get all the children of a ParentQuestionID
. I tried several solutions but still no luck. Any help would be greatly appreciated.