title: SQL update statements updates wrong fields
body: <p>I have the following code in Postgres</p>
  
  <pre><code>select op.url from identity.legal_entity le
  join identity.profile op on le.legal_entity_id =op.legal_entity_id     
  where op.global_id = '8wyvr9wkd7kpg1n0q4klhkc4g' 
  </code></pre>
  
  <p>which returns 1 row.</p>
  
  <p>Then I try to update the url field  with the following:</p>
  
  <pre><code>update identity.profile
  set url = 'htpp:sam' 
  where identity.profile.url in (
  select op.url from identity.legal_entity le
  join identity.profile op on le.legal_entity_id =op.legal_entity_id     
  where global_id = '8wyvr9wkd7kpg1n0q4klhkc4g'
  );
  </code></pre>
  
  <p>But the above ends up updating more than 1 row, actually all of the rows of the identity table.</p>
  
  <p>I would assume since the first postgres statement returns one row, only one row at most can be updated, but I am getting the wrong effect where all of the rows are being updated. Why ?? Please help a nubie fix the above update statement.</p>