title: Update a table when join with other table using Case in Postgresql
body: <p><a href="https://i.stack.imgur.com/iYMsY.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iYMsY.jpg" alt="enter image description here"></a></p>
  
  <p>I have 2 tables wherein I need the result as follows :<br>
   If the country name is 'United States' then the region should be hardcoded as 'Mexico' &amp; if the country name is 'Taiwan' then the region should be hardcoded as 'China' and for the rest it should be joined with the other table.
  <br>I have tried this query in Postgresql: </p>
  
  <pre><code>CASE 
      WHEN test.hypno.country_name hp RETURN 'United States'
          THEN UPDATE test.expected_details ed SET ed.place = 'Mexico'
      ELSE UPDATE test.expected_details ed 
           SET ed.place = hp.area_region 
           WHERE ed.WORK = hp.country_name
  END
  </code></pre>
  
  <p>How do I include another hardcode case for country 'Taiwan'? <br>Also, my query doesn't seem to be working in Postgresql.</p>