Since distributors can be assigned to another distributor
just like a customer, you may want to consider combining your
customer and distributor tables into a single entity (table) with
an attribute that identifies what class or category of user they
are, such as level 1 distributor, level 2 distributor, and
customer, etc. Then you could create a "link" table that allows you
to associate "customers" to level 1 distributors, and also
associate level2 distributors to level 1 distributors. Then your
query would be a snap, as you would select by distributor (user) id
on your "link" table, which would give you a list of all customers
and level 2 distributors associated with that level 1 distributor,
using the user attribute to identify which "type" they were.
It is similar in some respects to having an employee table,
where some are subordinates, and some are supervisors. They are all
employees, but you need to have a means of associating your
subordinates with their supervisors, and the supervisors to their
supervisors, etc.
Phil