• I tried but sequence is not correct 1012345 is child of 1055872 then 1012345 has to become a parent but result is not like that. It has to return like a chain link

    Result

    parent child childqty posno

    1055872 1012345 1.00001

    1055872 5030036 0.00742

    1055874 1001544 2.00001

    1055874 5030036 0.04832

    1055874 4000069 0.28003

    1001544 1012327 1.00001

    1001544 1012328 1.00002

    1001544 1012329 1.00003

    1001544 1012330 26.00004

    1001544 1012331 2.00005

    1001544 3000191 4.00006

    1012331 2020003 0.56911

    1012330 2020001 0.15301

    1012329 2020003 0.63611

    1012328 2020003 0.63611

    1012327 2020003 0.49461

    1012345 1012325 1.00001

    1012325 2020005 0.90561