B
Brad Wood
I have two tables: Kid and Parent
The Kid table has an optional foreign key into the parent
table for FatherID and another optional foreign key for
MotherID (a child may only have one parent).
I would like to write a query that would return:
Kid.Name | Parent.Name | Parent.Name
kiddy daddy mommy
So far I am only able to write one that returns:
Kid.Name | Parent.Name
kiddy daddy
kiddy mommy
The one for the above result set is:
SELECT Kid.Name, Parent.Name
FROM Parent INNER JOIN Kid ON
(Parent.ParentID=Kid.FatherID) OR
(Parent.ParentID=Kid.MotherID);
Can anyone show me a query that would give both parents in
one record?
The Kid table has an optional foreign key into the parent
table for FatherID and another optional foreign key for
MotherID (a child may only have one parent).
I would like to write a query that would return:
Kid.Name | Parent.Name | Parent.Name
kiddy daddy mommy
So far I am only able to write one that returns:
Kid.Name | Parent.Name
kiddy daddy
kiddy mommy
The one for the above result set is:
SELECT Kid.Name, Parent.Name
FROM Parent INNER JOIN Kid ON
(Parent.ParentID=Kid.FatherID) OR
(Parent.ParentID=Kid.MotherID);
Can anyone show me a query that would give both parents in
one record?