I have a table that looks like this
ID fname lname sponsor_id
1 Joe Smith 0
2 John Jones 1
3 Sue Wills 1
4 Bob Hass 3
I want to list all the leaders like this in descending order
ID fname lname number_sponsored
1 Joe Smith 2
3 Sue Wills 1
2 John Jones 0
4 Bob Hass 0
I cannot for the life of me figure out this join. Any one want to take a stab at this?
You can count the number sponsored in sub query