Updating multiple columns using Case
<p>I have a query that looks like below:</p>

<pre><code>UPDATE some_table
SET column_x = CASE WHEN x_specific_condition THEN new_value_for_x ELSE column_x END,
    column_y = CASE WHEN y_specific_condition THEN new_value_for_y ELSE column_y END, 
WHERE some_more_conditions
</code></pre>

<p>Problem with above is, each column (x, y) still gets updated with their own value if some_more_conditions return true irrespective of their specific conditions returning true. I tried removing ELSE from above, but no luck</p>

<p>I am combining as some_more_conditions are same for both cases, I think its better to perform all in 1 update (suggestions welcome)</p>

<p>Do you know if there is a way that I can perform the above update in 1 query by skipping the individual columns where the specific conditions do not match (basically avoid overwriting of same values)</p>