sxyzy 发表于 2016-10-21 09:35:10

MySQL字段自增自减的SQL语句

http://www.zhouz.me/post/2012-09-09/40038386113


update `info` set `comments` = IF(`comments`-1>=65535,0,`comments`-1) WHERE `id` = 32

update `info` set `comments` = IF(`comments`=0,0,`comments`-1) WHERE `id` = 32
页: [1]
查看完整版本: MySQL字段自增自减的SQL语句