You need to name the fields that are used to join two tables with the same names. For example,
Field1 as FieldA
Once the join to performed you can use the resident command again and create the new field with an if() statement.
Another option would be to perform a mapping load of one of the tables and the applymap() function in the other table to use the TableB field in TableA.