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    |
                +--------+-------+------+
  • 相关阅读:
    nice -n 10 bash 和 chrt 10 bash 和 echo -17 > /proc/PID/oom_score_adj
    使用NGINX+LUA实现WAF功能 和nginx 防盗链
    hdfs 通过命令坏块监测和删除或者地址获取参数做监控
    kafka 的server.properties
    ntpd服务
    kafka笔记博客
    k8s高可用
    K8S集群Master高可用实践
    String:字符串常量池
    如何设计出优秀的Restful API?
  • 原文地址:https://www.cnblogs.com/xlwu/p/13639755.html
Copyright © 2011-2022 走看看