lundi 13 juillet 2015

in sqlite, how to update a column to null conditionally

In Sqlite, how can I update a varchar column to null if the value has length 0, otherwise to the value.

In other words, something like this, using C-like syntax:

update T set C = (value.length() == 0 ? null : value) where ...;

Thanks.

Aucun commentaire:

Enregistrer un commentaire