Consider I have 4 columns in a table and i have datas for 3 columns like below
TableTest
Col1 | Col2 | Col3
D11 | D12 |
D21 | D22 |
Normally the update query would be
Update TableTest SET Col1 = D11 , Col2 = D12 , COL3 = newdata Where Col1= D11
The Scenario is , the update query should only push data to the COL3 , it should skip the Col1 and Col2, as it has already filled with data(even if same or different data for the Col1 and Col2)
.... SET Col2 = CASE WHEN Col2 = '' THEN 'newdata' ELSE Col2 END, .....
. this assumes meaning of empty is''
if null is empty or also expected you may need to modify theWHEN
accordingly – bansi 16 hours ago