zoukankan      html  css  js  c++  java
  • 27 修改数据:update

    27 修改数据:update
        
        语法格式:
            update 表名 set 字段名1=值,字段名2=值2... where条件;
            
        注意:没有条件整张表数据全部更新。
        
        案例:将部门10的LOC修改为shanghai,将部门名称修改为renshibu。
        update dept1 set loc = 'shanghai',dname='renshibu' where deptno = 10;
        
        select * from dept1;
            +--------+------------+----------+
            | DEPTNO | DNAME      | LOC      |
            +--------+------------+----------+
            |     10 | renshibu   | shanghai |
            |     20 | RESEARCH   | DALLAS   |
            |     30 | SALES      | CHICAGO  |
            |     40 | OPERATIONS | BOSTON   |
            |     10 | renshibu   | shanghai |
            |     20 | RESEARCH   | DALLAS   |
            |     30 | SALES      | CHICAGO  |
            |     40 | OPERATIONS | BOSTON   |
            +--------+------------+----------+
            
        更细所有记录
            update dept1 set loc = 'x',dname = 'y';
                select * from dept1;
                +--------+-------+------+
                | DEPTNO | DNAME | LOC  |
                +--------+-------+------+
                |     10 | y     | x    |
                |     20 | y     | x    |
                |     30 | y     | x    |
                |     40 | y     | x    |
                |     10 | y     | x    |
                |     20 | y     | x    |
                |     30 | y     | x    |
                |     40 | y     | x    |
                +--------+-------+------+
  • 相关阅读:
    ZSSR
    分享mysql db 分区分表的shell
    oracle12c的CDB与PDB
    nodejs连接redis
    webservice 访问 网络共享文件夹 权限问题的解决方案
    闭包后感
    简单记录几个wpf学习上的问题[ObservableQueue]
    源码分析之Iterable&Collection(一)
    数据结构之树(三)
    数据结构之哈希表(二)
  • 原文地址:https://www.cnblogs.com/xlwu/p/13639755.html
Copyright © 2011-2022 走看看