apolloren
格式:update 表名称 set 字段名称 = 字段名称 + 1  [ where语句] 
比如说数据库中有一张student表,要想把id为1的学生成绩(score)加1则
update student set score=score+1 where id = 1
如果你不加where系统就不会知道你具体要更新哪条记录,而导致所有该表中score都增加1,当然,除非这就是你的本意。

分类:

技术点:

相关文章: