I have an SQL statement that selects from a number of tables using left joins. But it's joining a table on a .NULL. value! Here's an example:
if the people record has no vehicle record linked to it, then tblVehicle.vehiclepk is null, as well as tblVehicle.Insurancefk. But it's joining a '1' from tblInsurance.insurancepk on the .NULL. value resulting from tblVehicle.insurancefk. How can a .NULL. be joined on a 1? Does anyone know a way around this? Why is this even happening?
BlackDice
Code:
select firstname,lastname from tblpeople ;
left join tblVehicle on tblVehicle.vehiclepk = tblpeople.vehiclefk ;
left join tblInsurance on tblInsurance.Insurancepk = tblVehicle.insurancefk
if the people record has no vehicle record linked to it, then tblVehicle.vehiclepk is null, as well as tblVehicle.Insurancefk. But it's joining a '1' from tblInsurance.insurancepk on the .NULL. value resulting from tblVehicle.insurancefk. How can a .NULL. be joined on a 1? Does anyone know a way around this? Why is this even happening?
BlackDice