当前位置:   article > 正文

mysql修改表中某个数据_mysql修改表中数据

mysql修改表中数据
  • update 表名 set 字段名=‘新内容’ + where条件
  1. mysql> select*from `runoob_tbl`;
  2. +-----------+--------------+---------------+-----------------+
  3. | runoob_id | runoob_title | runoob_author | submission_date |
  4. +-----------+--------------+---------------+-----------------+
  5. | 1 | 学习 PHP | 菜鸟教程 | 2018-08-15 |
  6. | 2 | 学习 MySQL | 菜鸟教程 | 2018-08-15 |
  7. | 3 | JAVA 教程 | RUNOOB.COM | 2018-08-15 |
  8. +-----------+--------------+---------------+-----------------+
  9. 3 rows in set (0.04 sec)
  10. mysql> update `runoob_tbl` set `submission_date`='2016-05-06' where `runoob_id`=3;
  11. Query OK, 1 row affected (0.16 sec)
  12. Rows matched: 1 Changed: 1 Warnings: 0
  13. mysql> select*from `runoob_tbl`;
  14. +-----------+--------------+---------------+-----------------+
  15. | runoob_id | runoob_title | runoob_author | submission_date |
  16. +-----------+--------------+---------------+-----------------+
  17. | 1 | 学习 PHP | 菜鸟教程 | 2018-08-15 |
  18. | 2 | 学习 MySQL | 菜鸟教程 | 2018-08-15 |
  19. | 3 | JAVA 教程 | RUNOOB.COM | 2016-05-06 |
  20. +-----------+--------------+---------------+-----------------+
  21. 3 rows in set (0.04 sec)

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/笔触狂放9/article/detail/592898
推荐阅读
相关标签
  

闽ICP备14008679号