can somebody explain me this - let's say I have 3 tables:
Now let's say 1 person has 2 addresses and 2 owned cars. And when I do JOIN over all for specific record like this:
SELECT Name, Street_Address, Car_Model FROM Person
LEFT JOIN ADDRESS ON PERSON.ID=ADDRESS.ID_FK
LEFT JOIN OWNEDCARS ON PERSON.ID=OWNDECARS.ID_FK
I get a result like this:
Mike, 4th avenue
Mike, 2nd avenue
As you notice, cars that were returned are doubled - what is happening here ? Why is JOIN returning correct number of addresess but not cars ?
What I want is to get Distinct records from all joined table which regards to certain record.
P.S: notice that I have same name for ID's in "Address" and "OwnedCars" table, which is "ID1_FK". That is my actual design, so I'm afraid that It has to do something with name conflicts.
Any advice appreciated, I'm quite a rooky when It comes to SQL.