I'd like to update all NULL fields in one table to 0. Of course
UPDATE mytable SET firstcol=0 WHERE firstcol IS NULL
would do the job. But I wonder if there´s a smarter solution than just c&p this line for every column.
I'd like to update all NULL fields in one table to 0. Of course
UPDATE mytable SET firstcol=0 WHERE firstcol IS NULL
would do the job. But I wonder if there´s a smarter solution than just c&p this line for every column.
ALTER TABLE
dataBaseName
.tableName
ADD COLUMNcolumnX
INT(20) NULL DEFAULT 1 AFTERcolumnY
;It does the following