I'm need to update sql table using if condition comparing another table. For example if phone numbers from 'a' table matches with 'b' table. The new column 'flag' is updated to Y/N.
Here's the code, it's working fine for 'Y' but how do I update the NULL or empty strings with 'N'
Here's the code:
update table_1 as a
set flag = 'Y'
from table_2 as b
where a.phone_numbers = b.phone_numbers
It is successfully working for 'Y' but how do I implement for 'N'
Thank you for your time ||