Skip to main content

Posts

Showing posts with the label update sql updating wrong values

update issue in mysql

update table temp set `a`=`a`+1 , `b`= `a`+ 1; this query sometimes doesn't yield the result we are actually looking for.. so the problem is `a` is getting updated first. So, the actual query should be : update table temp set `b`= `a`+ 1, `a`=`a`+1 ;