I have the following SQL:
UPDATE TableA
SET first_name = 'AAA',
last_name = 'BBB',
address1 = '123',
address2 = 'Fake St.,',
phone = '1234567',
id = '11223344'
What should I use to only update each column if it is not null?
update tableA
set first_name = case when first_name is null then null else 'aaa' end,
last_name = case when last_name is null then null else 'bbb' end,
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With