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    |
                +--------+-------+------+
  • 相关阅读:
    python random 随机选择操作
    分类预测,交叉验证调超参数
    7种炫酷HTML5 SVG液态水滴融合分解动画特效
    SAP WEBSERVICE Soap中RPC-style和Document-style
    Cocos2d-x 3.0final 终结者系列教程02-开发环境的搭建
    C#创建Excel文件并将数据导出到Excel文件
    某一天,忽然发现自己坚持不下去了。(无关计算机,仅仅是一些自己的困惑和感想)
    HDU4300-Clairewd’s message-KMP
    Java深入
    IOS UITextView光标位置在中间的问题
  • 原文地址:https://www.cnblogs.com/xlwu/p/13639755.html
Copyright © 2011-2022 走看看