How can I set a variable while doing an Update statement? I can’t seem to figure out the syntax.
So I want something like this below but it’s saying the syntax is wrong:
SET @tempVariable := 0;
UPDATE myTable SET col1 = 5, col2 = @tempVariable, @tempVariable := 100;
This is possible :-
To set an integer (not increment)