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>
原文地址:https://www.cnblogs.com/blogofwyl/p/4824712.html