I wanted to update columns based on condition: There is this table with columns A, B, C, D, E.
These columns with values are to be updated with null. I do not want to touch the columns without any values.
...
UPDATE
Table
SET
A = CASE WHEN A!=NULL THEN A=NULL
B= CASE WHEN B!=NULL THEN B=NULL
C= CASE WHEN C!=NULL THEN C='U'
D= CASE WHEN D!=NULL THEN D=NULL ELSE END,
WHERE
where condition;
...
PS:: The column values are not same.

Aucun commentaire:
Enregistrer un commentaire