Have three tables:
GroupTable Table
GroupId | GroupName
GroupCompanyRelation Table
GroupId | CompanyId
UserCompanyRelation Table
CompanyId | UserId
And this query:
SELECT grp.* FROM GroupTable grp
WHERE grp.GroupId IN
(SELECT gcr.GroupId FROM GroupCompanyRelation gcr WHERE gcr.CompanyId IN
(SELECT ucr.CompanyId FROM UserCompanyRelation ucr WHERE ucr.UserId = 1621733))
How can I make this same query using using joins? Seems like I should be able to get the same results using a join or 2 but then again I am a SQL dummy.