mysql - sql query for hierarchal search -


in below relational table, want search user id's whom are under particular sponsorid in hierarchical manner

user id     name            sponsor id 10030080    tulsi ram       10029866 10030079    sarabjeet kaur  10026043 10030078    manjit kaur     100042580 10030077    gurdas singh    10029579 10030076    tarlochan singh 10030072 10030075    gamer singh     10029943 10030074    juginder singh  10030068 10030073    malkin singh    10029740 10030072    parmodkumar     10030018 10030071    samitra devi    10030070 10030070    lohan lal       10030016 10030069    kashmir singh   10030057 10030068    sukhpal singh   10029862 10030067    sandeepsingh    10030066 10030066    gurmelsingh     10030065 10030065    kuldeep kaur    10030064 10030064    harpreet kaur   10030063 10030063    kalwinder kaur  10030062 

please suggest query


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -