Chinaunix首页 | 论坛 | 博客
  • 博客访问: 52767
  • 博文数量: 16
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 180
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-23 18:04
文章分类

全部博文(16)

文章存档

2010年(16)

我的朋友

分类: Oracle

2010-10-28 15:35:53

 

 

WHEN MATCHED THEN
UPDATE SET column = { expr | DEFAULT }
           [, column = { expr | DEFAULT } ]...
[ where_clause ]
[ DELETE where_clause ]

在语法中DELETE 之前不常用,ORACLE解释为:

Specify the DELETE where_clause to clean up data in a table while populating or updating it. The only rows affected by this clause are those rows in the destination table that are updated by the merge operation. That is, the DELETE WHERE condition evaluates the updated value, not the original value that was evaluated by the UPDATE SET ... WHERE condition. If a row of the destination table meets the DELETE condition but is not included in the join defined by the ON clause, then it is not deleted. Any delete triggers defined on the target table will be activated for each row deletion.

使用delete where_clause 处理的数据是目标表中被merge 操作更新后数据,也就是被update set 更新后的数据,

即:以下数据将被删除:

1、符合ON条件。

2、被update 更新后符合delete where 条件的数据。

 

 

阅读(937) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-29 14:51:29

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com