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
I tested a similar query using a select and it worked for me, so I would rewrite your query as follows
SET @tempVariable := 0; UPDATE myTable SET col1 = 5, col2 = (SELECT @tempVariable + 100);
Hope that helps.