Sql to order user-managers so that the highest manager appears first
9 views
Skip to first unread message
Anoop
unread,
Nov 16, 2007, 2:03:40 AM11/16/07
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sql-users
I have a typical user-manager table, where a manager can have direct
reports under him and be a direct report to another manager as well.
How can I sort the table (using sql order by or something) so that the
hierarchy is maintained in the query result?
For example: my table contains direct report - manager relationship
like: (user1 has no manager - is the top: CEO or something)