zoukankan      html  css  js  c++  java
  • 19.修改表中数据

    19.1 修改表中指定条件固定列的数据

    1、命令语法:update <表名> set <字段>=<新值>,..... where <条件> (一定要注意条件)

    2、修改指定的行字段内容
    查看要修改的表

    mysql> use oldboy;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    Database changed
    mysql> select * from test where id=4; 把 id 号为 4,name=zhangxuan 的更改为 name=pengchun
    +----+------+-----------+-------------+
    | id | age | name | shouji |
    +----+------+-----------+-------------+
    | 4 | 24 | zhangxuan | 13511111111 |
    +----+------+-----------+-------------+
    1 row in set (0.00 sec)
    mysql> update test set name='pengchun' where id=4;
    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1 Changed: 1 Warnings: 0
    mysql> select * from test where id=4;
    +----+------+----------+-------------+
    | id | age | name | shouji |
    +----+------+----------+-------------+
    | 4 | 24 | pengchun | 13511111111 |
    +----+------+----------+-------------+
    1 row in set (0.00 sec)​
  • 相关阅读:
    令Django 视图有默认 login_required
    令Django 视图有默认 login_required
    Python 资源
    Python 资源
    小米3 日历 同步google日历
    小米3 日历 同步google日历
    sql语句 case
    DDOSIM安装
    DDos工具tfn2k的编译
    RPM和YUM
  • 原文地址:https://www.cnblogs.com/hackerlin/p/12539898.html
Copyright © 2011-2022 走看看