mysql怎么修改表的单个数据
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 |
+-----------+--------------+---------------+-----------------+
3 rows in set (0.04 sec)
mysql> update `runoob_tbl` set `submission_date`='2016-05-06' where `runoob_id`=3;
Query OK, 1 row affected (0.16 sec)
Rows matched: 1 Changed: 1 Warnings: 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 |
+-----------+--------------+---------------+-----------------+
3 rows in set (0.04 sec)
声明:本站所有作品(图文、音视频)均由用户自行上传分享,或互联网相关知识整合,仅供网友学习交流,若您的权利被侵害,请联系 管理员 删除。
本文链接:http://news.ew35.com/