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)​
  • 相关阅读:
    SQL逻辑查询语句执行顺序
    数据库索引的实现原理
    JAVAMail邮件服务器
    TCP/IP基础
    Java IO流学习总结
    [Lydsy1806月赛] 超速摄像头
    CodeForces
    SCU
    CodeForces
    CodeForces
  • 原文地址:https://www.cnblogs.com/hackerlin/p/12539898.html
Copyright © 2011-2022 走看看