Can you post an actual dump of the table structure and try to explain the relationships? It seems like this may be more of a design flaw than a bad query.
Quote:
|
I wonder if the columns 'parents' and 'family_Id' should have the same name?
|
The names of the columns won't matter as long as the data in them is correct.
My next guess at a suitable query would be something like:
Code:
SELECT
i.IndivId
, i.Surname
, i.First_Names
, i.Parents,
(SELECT
i2.Surname
FROM
individuals i2
, families f
WHERE
(i2.IndivId = f.father_ID)
AND
(i.Family_ID = f.Family_ID)
) as Father
FROM
individuals i
WHERE
...
Make sure the nested select is getting the right values independently. Just replace i.Family_ID with values.