时间:2022-12-06 01:54
mysql修改表数据语句的写法:
语法格式
update表名set字段名=‘新内容’+where条件
示例
mysql>select*from`runoob_tbl`;+-----------+--------------+---------------+-----------------+
|runoob_id|runoob_title|runoob_author|submission_date|
+-----------+--------------+---------------+-----------------+
|1|学习PHP|菜鸟教程|2018-08-15|
|2|学习MySQL|菜鸟教程|2018-08-15|
|3|JAVA教程|RUNOOB.COM|2018-08-15|
+-----------+--------------+---------------+-----------------+
3rowsinset(0.04sec)
mysql>update`runoob_tbl`set`submission_date`='2016-05-06'where`runoob_id`=3;
QueryOK,1rowaffected(0.16sec)
Rowsmatched:1Changed:1Warnings:0
mysql>select*from`runoob_tbl`;
+-----------+--------------+---------------+-----------------+
|runoob_id|runoob_title|runoob_author|submission_date|
+-----------+--------------+---------------+-----------------+
|1|学习PHP|菜鸟教程|2018-08-15|
|2|学习MySQL|菜鸟教程|2018-08-15|
|3|JAVA教程|RUNOOB.COM|2016-05-06|
+-----------+--------------+---------------+-----------------+
3rowsinset(0.04sec)