用于分层搜索的SQL查询

时间:2015-03-28 19:40:53

标签: mysql search join

在下面的关系表中,我想以分层方式搜索任何特定赞助商下的所有用户ID

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

请建议查询

0 个答案:

没有答案