开发者学堂课程【MySQL 数据库入门学习:更新表数据】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/451/detail/5579
更新表数据
update语句
修改单列:
update 表名 set 列名=xxx[where字句]
修改多列:
update 表名 set 列名1=xxx,列名2=xxx...[where字句]
演示:
修改 book 表中 content 值为’nice day’并查看 boo k 表
修改 book 表中 id 为3的列 content 值 为’ day’并查看 book 表
修改 book 表中 id 为3的列 content 值 为’bad day’以及 title 为‘nice tree’并查看 book 表
总结:
update 语句用来修改表中的数据。