mercredi 22 juillet 2015

Set a column if another column is not empty

I have a table where I want to switch a 1 to a 0 in one column, only if another column is not empty. I tried this, but I have a syntax error.

UPDATE table SET column = 0 WHEN another_column is not null;

Can anyone help?

Aucun commentaire:

Enregistrer un commentaire