So suppose I have a simple query like below; (its an example, I know that is not proper syntax, but the logic stays the same).
for(let i=1; i<len; i++){
UPDATE table1
SET table1.col1 = i
WHERE table1.id = arr[i]
}
I want to avoid doing 10 or 20 queries, so I was wondering how to remove the for, perhaps something like
UPDATE table1
SET table1.col1 = ? #<<how to add the increment here.>>
WHERE table1.id IN (arr)