Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> UPDATE SET of multiple columns
I have a table with several columns that may have null values.
I want to set the columns to 0 if they are null.
An UPDATE statement like this below gives me a syntax error, but how could all the columns be set to 0 in one update statement?
Thanks.
C
update DISK_STATS_TBL
set DISKBSIZE_STAT = 0 where DISKBSIZE_STAT IS NULL,
DISKBUSY_STAT = 0 where DISKBUSY_STAT IS NULL, DISKREAD_STAT = 0 where DISKREAD_STAT IS NULL, DISKWRITE_STAT = 0 here DISKWRITE_STAT IS NULL, DISKXFER_STAT = 0 where DISKXFER_STAT IS NULL, DISKSERV_STAT = 0 where DISKSERV_STAT IS NULL;
*ERROR at line 2: