what does NOT mean in UPDATE SQL?


Search Google and I can not find an answer for this, it seems easier to ask here.

UPDATE table
SET Paciente = Juan Perez
WHERE RowID IN NOT (1,2.3)
asked by Juan Carlos Villamizar Alvarez 18.09.2016 в 06:22

2 answers


The IN operator allows you to specify multiple values with which a column can match. For example:

FROM tabla
WHERE nombre IN ('Fulano', 'Mengano')

For the opposite, use NOT IN to specify the condition that a column does not have one of the listed values.

In the example you published, all records that do not have a RowID equal to 1, 2 or 3 are updated.

UPDATE table
SET Paciente = 'Juan Perez'
WHERE RowID NOT IN (1,2,3)
  • Note that the NOT goes before the IN , and that the value of the field should go as text in quotation marks.
answered by 18.09.2016 / 06:42

In general it means NO , in this case that NO pertenezca a un conjunto . And in your context, the RowID NO is none of those

answered by 18.09.2016 в 06:42