Good afternoon guys.
I would like to know if it is possible to make a UPDATE
to NULL
where the field only allows UNIQUE
values.
I tried this way:
update FUNCIONARIO set codigocartao = NULL where situacao = 'DESATIVADO'
But I got the duplicate registry error.
The scenario I need is: the encoding field must have a unique record, but it can also be null.
the scenario I have today is: every time I need to set the field to NULL
, I end up having to delete the table official.
Am I doing something wrong or does not this possibility exist in MySQL
?
Anyone have any ideas?