Skip to content
Advertisement

Sql update query using When condition

The example below apply null values into the field nom for the others id, how can forbid this action so that it does not modify the already existing values ​​and that I do not wish to modify ?

Advertisement

Answer

One way is with else:

But if you just want to update the rows that match, then use WHERE:

No need to attempt to update every row if you know which one you want to change.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement