Question: SELECT GP 1 . Name AS GrandFather, GP 2 . Name AS GrandMother, Grandson.Name AS Grandson FROM Parent Pa 1 JOIN Parent Pa 2 ON
SELECT GPName AS GrandFather, GPName AS GrandMother, Grandson.Name AS Grandson
FROM Parent Pa
JOIN Parent Pa ON PaChildID PaParentID AND PaParentID PaParentID
JOIN Person GP ON PaParentID GPPersonID
JOIN Person GP ON PaParentID GPPersonID
JOIN Person Grandson ON PaChildID Grandson.PersonID
WHERE GPName GPName, GPGender M AND GPGender F;
How do I get the SQL Query to return the table with Grandfathers and Grandmothers in their own columns and show the grandsons
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
