title: How to cross reference an id to another column in sql?
body: <p><a href="https://i.stack.imgur.com/ey5o7m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ey5o7m.png" alt="TableA"></a></p>
  
  <p>Given the table shown above, what I need to do is if the COUNTRY field for a particular ID is NULL, then pick that corresponding UNDERLYING_ID, and cross-reference it to the ID column and pick the COUNTRY value from the row where the UNDERLYING_ID matches the ID. </p>
  
  <p>So in this case, A701 will have a country value of JAP because the underlying_ID A706 has a match in the ID column (last record)</p>
  
  <p>Not sure how to write the query here. Please advise.</p>