While cross-join syntax is a direct translation of what you have provided, this may not be right for your situation. This would link all people to all jobs before they joined the pay table. It does not seem likely that this is what you want.
Do you really have people who are not connected with salaries? In this case, do you want to see any jobs that are not related to salaries or people? Sample data and a result set will help us give you a query that does what you really need. I suspect one of the following might give you better results:
SELECT p.Name, j.Job, s.Salary FROM PeopleTable p JOIN SalaryTable s ON s.PeopleID=p.PeopleID RIGHT JOIN JobTable j ON s.JobID=j.JobID SELECT p.Name, j.Job, s.Salary FROM PeopleTable p JOIN SalaryTable s ON s.PeopleID=p.PeopleID JOIN JobTable j ON s.JobID=j.JobID SELECT p.Name, j.Job, s.Salary FROM SalaryTable s RIGHT JOIN PeopleTable p ON s.PeopleID=p.PeopleID RIGHT JOIN JobTable j ON s.JobID=j.JobID
Hlgem
source share