blogofwyl

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>

 

发表于 2015-09-20 23:15  复制乔布斯  阅读(1445)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2021-10-27
  • 2021-11-04
  • 2021-10-20
  • 2022-12-23
  • 2021-09-01
  • 2021-05-31
猜你喜欢
  • 2021-11-24
  • 2021-10-29
  • 2021-11-19
  • 2022-02-07
  • 2021-08-14
  • 2022-12-23
  • 2021-11-01
相关资源
相似解决方案