Guest_imported
New member
- Jan 1, 1970
- 0
- 0
- 0
The name of the Tabe is Tab_Sponsor with columns
Sponsor Numeric(6) NOT NULL
Name Varchar(30) NOT NULL
Reporting_To Numeric(6) NULL
The records for the above table are as below
Sponsor Name Reporting_To
1 Tony -
2 Ricard 1
3 Bob 2
4 David 2
5 Harry 2
6 Raymond 4
7 Rex 6
8 Viv 6
If I want to all the Persons Reporting to 2 then it should return me 3,4,5,6(6->4->2),7,8
Can you please help me in formulating the query please
Sponsor Numeric(6) NOT NULL
Name Varchar(30) NOT NULL
Reporting_To Numeric(6) NULL
The records for the above table are as below
Sponsor Name Reporting_To
1 Tony -
2 Ricard 1
3 Bob 2
4 David 2
5 Harry 2
6 Raymond 4
7 Rex 6
8 Viv 6
If I want to all the Persons Reporting to 2 then it should return me 3,4,5,6(6->4->2),7,8
Can you please help me in formulating the query please