I have an sql question.  I have a table that holds user information that
includes their id and who they report to.

user
-----
id (int)
supervisor (int)

This heirarchy goes several levels deep.  Without changing the db structure,
what is my easiest way to determine if user x is a supervisor for user y?
User x may not be the immediate supervisor, but may be a supervisor or his
supervisor, etc.

I can do it with PHP by gettign the supervisor, then getting the
supervisor's supervisor, etc, but this is slow.  Any other ideas will be
very much appreciated!

Thanks,
Scott

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to