• 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>
  • 相关阅读:
    Eclipse 代码模板
    Eclipse 安装插件
    Eclipse 任务管理
    Eclipse 添加书签
    Eclipse 重构菜单
    Eclipse 浏览(Navigate)菜单浏览 Eclipse 工作空间
    Eclipse 查找
    Eclipse 悬浮提示
    Eclipse 快速修复
    Eclipse 内容辅助
  • 原文地址:https://www.cnblogs.com/blogofwyl/p/4824712.html
Copyright © 2020-2023  润新知