I need to update the table fields and substitute the value of the variable to be incremented, namely
DECLARE counter int2 = 0; BEGIN UPDATE table SET field1 = counter++ (не работает, взял для наглядности) WHERE field2 IN (1,2,3,45,56,76)
Tell me how it is done in PostgreSQL.
thank
PS I know about field1 = field1 + 1, the task is the above