5.MySQL增删改查(3)——修改元素

2022-10-26 15:13:46 浏览数 (2)

格式:

update [表名] set [列名] = [修改的值]

1.把某同学的数学成绩改成80;

update exam_result set math = 80 where name = ‘孙悟空’;

2.把所有同学的数学成绩减十分;

update exam_result set math = math-10;

3.把倒数三名的语文成绩加上5分;

update exam_result set chinese=chinese 5 order by chinese math english asc limit 3;

0 人点赞