title: How to work in case in join condition
body: <p><a href="https://i.stack.imgur.com/TkVEZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TkVEZ.png" alt="enter image description here"></a></p>
  
  <p>How to find city when ContactID is provided and condition is if ContactID is coming as 123 then it will look whether it is P or C, If P then it will go to Person table and returns City(USA) as output and If C then it will go to Company table and gives City(AUS) as output.
  NB: all tables contain thousands of record and City value comes from run time.</p>