I have a table called userstbl that has supId (supervisor) and has also userID with relation: one to many -> supid has many userid (same table).
ex.
- uid:1
name: john
supid:
......
- uid:2
name: smith
supid: 1
How do I get all users grouped by supervisor name? thanks
Join the table with itself. In order to do that you will need to alias the table. Something like