I have 1 id column and 3 int columns. Data is inserted in this way
insert into table (col1, col2) values (1,1)
insert into table (col2, col3) values (1,1)
insert into table (col1, col3) values (1,1)
insert into table (col1) values (1)
then, row 1, col 3 is null row 2, col 1 is null, row 3, col 2 is null. row 4, col 2 and col 3 are null.
I want to replace the null values with 0. How can I do that?
Note: I won't know which columns are null, so i can't use ISNULL(colname, 0)
ISNULLon each column. What's the problem?ISNULLorCOALESCEfor each column to be updated.