I am trying to write a query in the following lines:
UPDATE Table i2
SET value = 0
WHERE EXISTS (SELECT 1 FROM Table i1 WHERE i2.ID = i1.ID+1)
The problem is that I get "Wrong syntax near" i2 "." I suppose this is due to the fact that he does not like to give an alias to the table being updated, but if so, how should I refer to it?
source
share