Reputation:
I have three tables as following:
I want to select values of (userid from tbladmin) and (compname from tblcompany)
Basically userid is the username name and compname is the company name. I want the name of the company/companies the user is affiliated to.
Hoping for answer.
Upvotes: 0
Views: 43
Reputation: 7240
Join these tables:
select a.userid,c.compname
from tbladmin a
inner join userrights r on a.id=r.id
inner join tblcompany c on r.compid=c.compid
Upvotes: 2