You need to drive your query from the
JobTable, then do an INNER JOIN to the organisation table just to get the name (of the organisation)
But you need to do that join twice because you have 2 foreign keys in your jobtable table. E.g.
select jobId, OPICK.OrgName, Odrop.OrgName
from jobtable J
inner join organization Odrop on j.DropOrgName = odrop.id
inner join organization Opick on j.pickOrgname = opick.id
Note - the first join to organization is to get the name for the
drop organisation, the second is to get the name for the
pick organisation. The thing that you are really "interested in" is the
Job ... so put that into your query first.
Yes - people will argue that it doesn't matter what order the tables appear in if you are using inner joins ... but when you come back to your code in days, weeks, months, years to come it makes it clearer what you were trying to do (bit of advice from an old lag)