Oracle中Merge的使用
MERGE INTO products p
USING product_changes pc
ON (p.product_id = pc.product_id)
WHEN MATCHED THEN --当匹配上时进行更新操作
UPDATE
SET p.product_type_id = pc.product_type_id,
p.name = pc.name,
p.description = pc.description,
p.price = pc.price
WHEN NOT MATCHED THEN --当不匹配上时进行插入操作
INSERT
(p.product_id, p.product_type_id, p.name, p.description, p.price)
VALUES
(pc.product_id, pc.product_type_id, pc.name, pc.description, pc.price);
Oracle中Merge的使用的更多相关文章
- Oracle中merge into的使用
http://blog.csdn.net/yuzhic/article/details/1896878 http://blog.csdn.net/macle2010/article/details/5 ...
- Oracle中merge into的使用 (转)
该命令使用一条语句从一个或者多个数据源中完成对表的更新和插入数据. ORACLE 9i 中,使用此命令必须同时指定UPDATE 和INSERT 关键词,ORACLE 10g 做了如下改动. 1.ins ...
- Oracle中merge into的使用 (转)
http://blog.csdn.net/yuzhic/article/details/1896878 http://blog.csdn.net/macle2010/article/details/5 ...
- Oracle中Merge into用法总结
MERGE语句是Oracle9i新增的语法,用来合并UPDATE和INSERT语句.通过MERGE语句,根据一张表或子查询的连接条件对另外一张表进行查询,连接条件匹配上的进行UPDATE,无法匹配的执 ...
- 转:Oracle中merge into的使用
最近项目上使用Oracle的Merge,所以找来一下资料学习了解. 该命令使用一条语句从一个或者多个数据源中完成对表的更新和插入数据. ORACLE 9i 中,使用此命令必须同时指定UPDATE 和I ...
- oracle中merge的详解
Oracle在9i引入了merge命令, 通过这个merge你能够在一个SQL语句中对一个表同时执行inserts和updates操作. 当然是update还是insert是依据于你的指定的条件判断的 ...
- Oracle中MERGE语句的使用
Oracle在9i引入了merge命令, 通过这个merge你能够在一个SQL语句中对一个表同时执行inserts和updates操作. 当然是update还是insert是依据于你的指定的条件判断的 ...
- oracle中merge的用法,以及各版本的区别 Create
Merge是一个非常有用的功能,类似于Mysql里的insert into on duplicate key. Oracle在9i引入了merge命令,通过这个merge你能够在一个SQL语句中对一个 ...
- Oracle中Merge into的用法实例讲解
最近在做一个需求,就是涉及到表的问题,前端传过来一条数据,根据主键,查询数据库,如果不存在,那么久插入到数据库中一条,如果存在的话,就是以主键的方式,对数据库中的数据,进行更新. 拿到这个需求的时候, ...
- oracle中merge方法
先看SQL语句:merge into employee e using emps em on (e.emp_id=em.emp_id) when matched then update set e. ...
随机推荐
- npm私服搭建
本文是在 centos7 下利用 nexus 搭建 npm 私服的整理 一.安装 JDK 1.下载 JDK 2.安装 tar zxvf jdk-8u191-linux-x64.tar.gz .0_19 ...
- 课程一(Neural Networks and Deep Learning)总结——2、Deep Neural Networks
Deep L-layer neural network 1 - General methodology As usual you will follow the Deep Learning metho ...
- SSH框架整合详细分析【执行流程】
struts1和spring有两种整合的方法 一种是action和spring bean映射:一种是将action交给spring初始化 第一种方式:访问.do的URL->tomcat接收到r ...
- Shellexecute头文件
调用ShellExecute所需要头文件 #include "windows.h " #include "shellapi.h "
- 【IT笔试面试题整理】给定二叉树,给每层生成一个链表
[试题描述]定义一个函数,给定二叉树,给每层生成一个链表 We can do a simple level by level traversal of the tree, with a slight ...
- 我眼中的优秀技术leader
在这家公司工作的四年时间里,我一共接触过两个在技术团队里有很大影响力的leader.本文将基于我在工作中对他们的观察,总结一下他们身上所具有的特质,以作为自己学习的榜样.标题中的“我眼中的”,不仅表示 ...
- 人工智能日常应用举例-nlp+视觉(听说看)
- GCD之同步异步
博客地址:http://blog.csdn.net/chaoyuan899/article/details/12554603
- [转]Magento on Steroids – Best practice for highest performance
本文转自:https://www.mgt-commerce.com/blog/magento-on-steroids-best-practice-for-highest-performance/ Th ...
- [转]NodeBB 环境搭建
本文转自:https://my.oschina.net/pauli/blog/198405 摘要: Windows 7 下面 NodeBB (https://nodebb.org/)环境搭建 ...