Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UPDATE `table_name`
- SET `var`=1
- WHERE `condition`='value' AND `var`=0
- //or
- UPDATE `table_name`
- SET `var`= CASE
- WHEN `var`=0 THEN 1
- ELSE `var`
- END
- WHERE `condition`='value'
- //or
- UPDATE `table_name`
- SET `var`= IF(`var`=0,1,`var`)
- WHERE `condition`='value'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement