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

oracle 更新表

发布时间:2020-12-12 14:59:56 所属栏目:百科 来源:网络整理
导读:更改表中的数据:1、更新特定行; 2、更新所有行。 注意:更新时一定要注意添加上where条件,否则,更新表中所有行数据。 格式: 更新特定行:update table set table_xxx='aaaaaa' where table_id='bb'; 更新多行:update table set table_xxx='aaaaaa', ta

更改表中的数据:1、更新特定行;

2、更新所有行。

注意:更新时一定要注意添加上where条件,否则,更新表中所有行数据。

格式: 更新特定行:update table

set table_xxx='aaaaaa'

where table_id='bb';

更新多行:update table

set table_xxx='aaaaaa',

table_city='cc',

……

table_name='dd'

where table_id='bb';


示例:update customers

set cust_email='1111@126.com'

where cust_name='yang'


要想删除表中的某个列的值,可设置它为NULL(假定表定义允许NULL值)。

update customers set cust_email='null ' where cust_name='yang'

NULL用来去除cust_email列中的值,NULL表示没有值。而字符串‘’表示一个值。

(编辑:李大同)

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

    推荐文章
      热点阅读