以下に示すように、階層データを持つテーブルがあります。
**childtype chidvalue parenttype parentvalue**
1001, child1, 1000, testParent
1001, child2, 1000, testParent
1002, child3, 1000, testParent
1003, child4, 1002, child3
1004, child5, 1003, child4
入力は親の値になります。たとえば、'testParent' であり、'testParent' の子の値を含むすべてのレコードを再帰的にフェッチする必要があります。サブレベルの数は以前は不明です。そして、単一の SQL クエリを使用してこれを達成する必要があります。誰でも助けてください
前もって感謝します