I finally have the Ids query corrected(after 20 years);
Select (Select ParentA__c From ChildA__r) From ParentB s WHERE Id IN (Select s.ParentB From ChildB s)
I now have the IDs I would need to populated the lookup field in ChildB.
The criteria would be if the ParentB Id of ChildB (Master-Detail) field = ParentB Id of ChildA ( Master Detail ) field
Get ParentA Id of that ChildA and populate the ParentA Id Lookup up field in ChildB.
( Hope it made a lot of sense )
Now the issue is I cannot get it to materialize.
Hope this is simple enough for a favor to ask.
How would you code this? Specially the Upsert part?