How to find last level agent from the sponsor_id using recursive function?
<p>How to find all agents which are working under given agent_id using recursive function?
And how To print returned list?</p>

<pre><code>agent_id    agent_sponsor_id    agent_code

        100001  100007  MH100001
        100002  100007  MH100002
        100003  100007  MH100003
        100004  100007  MH100004
        100005  100007  MH100005
        100006  100007  MH100006
        100007  100014  MH100007
        100008  100014  MH100008
        100009  100014  MH100009
        100010  100014  MH100010
        100011  100014  MH100012
        100013  100014  MH100013
        100014  100015  MH100014
        100015  100020  MH100015
        100016  100020  MH100016
        100017  100020  MH100017
        100018  100020  MH100018
        100019  100020  MH100019
        100020  100027  MH100020
        100021  100027  MH100021
        100022  100027  MH100022
        100023  100027  MH100023
        100025  100027  MH100025
        100026  100027  MH100026
        100027  100031  MH100027
        100028  100031  MH100028
        100029  100031  MH100029
        100030  100031  MH100030
        100031  100035  MH100031
        100032  100035  MH100032
</code></pre>
