加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何修改Oracle表中的数据

发布时间:2020-12-12 14:37:05 所属栏目:百科 来源:网络整理
导读:一 语法 UPDATE table_name SET column1=value1,... [WHERE conditions] 二 实例 1、无条件更新 SQL update userinfo 2 set userpwd = '222221' ; 已更新 4 行。 SQL select userpwd from userinfo ; USERPWD -------------------- 222221 222221 222221 222

一 语法

UPDATE table_name SET column1=value1,... [WHERE conditions]
二 实例 1、无条件更新
  1. SQL> update userinfo
  2. 2set userpwd='222221';
  3. 已更新4行。
  4. SQL>select userpwd from userinfo;
  5. USERPWD
  6. --------------------
  7. 222221
  8. 222221
  9. 222221
  10. 222221
  11. SQL> update userinfo
  12. 2set userpwd='111',email='cakin@qq.com';
  13. SQL>select userpwd,email from userinfo;
  14. USERPWD EMAIL
  15. --------------------------------------------------
  16. 111 cakin@qq.com
  17. 111 cakin@qq.com
  18. 111 cakin@qq.com
  19. 111 cakin@qq.com
2、有条件更新
  1. SQL> update userinfo
  2. 2set userpwd ='1234567'
  3. 3where username='xxx'
  4. 4;
  5. 已更新1行。
  6. SQL>select username,userpwd from userinfo;
  7. USERNAME USERPWD
  8. ----------------------------------------
  9. xxx 1234567
  10. yyy 111
  11. 111
  12. 111

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读