I have a table called "child_parent" which lists ID's of children and their parents, referring to, say, a table called "person". The child-parent pair are unique, and a child can have no more than two parents.
child parent
3 1
3 2
4 1
7 8
I want a table of the "other" parent (call it "ChildOfpID_OtherParent") of all children with parent ID (pID) equal to, say, 1 with NULL if the other parent is not listed. So if pID=1, I want:
child_of_pID other_parent
3 2
4 NULL
I'm having trouble figuring out how to generate such a table.