Complex Join Using Query

Complex Join Using Query

jcbeaujcbeau Posts: 6Questions: 0Answers: 0
edited October 2013 in Editor
Hello,

I have a scenario where I would like to show a list of users based on the current rank of the user logged in. The rank of the user is stored in another table. So the query would effectively be:

[code]
SELECT USERS.USERNAME
FROM USERS,
ROLES
WHERE USERS.ROLE_ID = ROLES.ROLE_ID
AND ROLES.RANK_ID < Current User Rank
[/code]

Is this possible using the Query.php class?

I have the join working to pull in rolename (not shown), but I can't seem to get the [code]->where()[/code] to work with a join to another table.

Any help would be very much appreciated.

Thanks! --Jeff
This discussion has been closed.