Query sql server to delete an ID and a COLUMN

0

This I just invented and it does not work

    delete a.valor 
    from persona a 
    where a.Id = 3

How can I delete only 555

    
asked by Rodrigo Rodriguez 19.12.2017 в 17:20
source

1 answer

1

I understand why you thought that a DELETE judgment would be necessary. But take into account that the verb in the sentence applies to the record, not to an individual field. And since your intention is not to delete ( DELETE ) the record, but to update the record by emptying a field, then the verb to use is UPDATE :

update persona
   set valor = null
 where id = 3

Of course, this assumes that your valor column is set to accept NULL values.

    
answered by 19.12.2017 / 17:21
source