zoukankan      html  css  js  c++  java
  • oracle----修改表中的数据

    1. 修改表中的数据:UPDATE语句:

    语法:

    UPDTAE table_name
    SET column1 = value1,...
    [WHERE conditions]

    (2),无条件的更新(没有where条件的更新):

    SQL> update userinfo set userpwd='111111';
    
    已更新4行。
    SQL> select userpwd from userinfo;
    
    USERPWD
    --------------------
    111111
    111111
    111111
    111111
    
    SQL>

    更改多个字段以都好分隔;

    SQL> update userinfo set userpwd='111',email='111@163.com';
    
    已更新4行。
    
    SQL> select userpwd,email from userinfo;
    
    USERPWD              EMAIL
    -------------------- ------------------------------
    111                  111@163.com
    111                  111@163.com
    111                  111@163.com
    111                  111@163.com
    
    SQL>

    (2),有条件的更新:

    SQL> select username from userinfo;
    
    USERNAME
    --------------------
    xxx
    yyy
    
    SQL> update userinfo set userpwd='123456'
      2  where username='xxx';
    
    已更新 1 行。
    
    SQL> select id,username,userpwd from userinfo;
    
            ID USERNAME             USERPWD
    ---------- -------------------- --------------------
             1 xxx                  123456
             2 yyy                  111
             3                      111
             4                      111
    
    SQL>
  • 相关阅读:
    读《见识》 | 当别人扇了你一巴掌
    Java集合类
    Java数据结构简述
    Java加密算法
    Java JDK与JRE
    Java String、StringBuilder、StringBuffer[笔记]
    Java同步(Synchronization)
    Java断言(Assertion)
    Java strictfp
    Java Native Interface(JNI)
  • 原文地址:https://www.cnblogs.com/blogofwyl/p/4824712.html
Copyright © 2011-2022 走看看