I have 2 tables wherein I need the result as follows :
If the country name is 'United States' then the region should be hardcoded as 'Mexico' & 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.
I have tried this query in Postgresql:
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
How do I include another hardcode case for country 'Taiwan'?
Also, my query doesn't seem to be working in Postgresql.