merge select-merge insert select问题

问题描述

merge insert select问题

MERGE INTO yn_netcut.his_rms_bts_in_net A
USING ( SELECT A.FLOW_NO,B.ACTIVITYDEFID,B.WORKITEMNAME FROM yn_netcut.t_bpm_form_info A,yn_netcut.wfworkitem B WHERE A.PROC_INS_ID=B.PROCESSINSTID
AND A.Flow_Model='com.inspur.app.btsInNetNew.process.btsInNet')B
ON(A.Apply_Id=B.FLOW_NO AND A.STEP_ID=B.ACTIVITYDEFID)
WHEN NOT MATCHED THEN
INSERT(his_int_id, int_id, standard_name, zone_id, city_id, related_site,
equiproom_id, longitude, latitude, altitude, vendor_id, equipment_model, fre_band, trx_num,
cell_num,
village_flag, bts_sort, btscover_type, coverage_type, is_net, address, bts_no, related_bsc, cells_type,
trans_type, inuse_date, contingency_type, op_vendor, repair_vendor, softwareversion,
powershare_flag,
permanent_assets_no, portect_type, stateflag, modify_by, modify_date, create_by, create_date, apply_id,
step_id, buider, zone_name, city_name, vendor_name, related_site_name,
equiproom_name, related_bsc_name
)VALUES(SELECT seq_eomsirms_info.nextval,int_id, standard_name, zone_id, city_id, related_site,
equiproom_id, longitude, latitude, altitude, vendor_id, equipment_model, fre_band, trx_num,
cell_num,
village_flag, bts_sort, btscover_type, coverage_type, is_net, address, bts_no, related_bsc, cells_type,
trans_type, inuse_date, contingency_type, op_vendor, repair_vendor, softwareversion,
powershare_flag,
permanent_assets_no, portect_type, stateflag, modify_by, modify_date, create_by, create_date, apply_id,
B.ACTIVITYDEFID, buider, zone_name, city_name, vendor_name, related_site_name,
equiproom_name, related_bsc_name FROM yn_netcut.his_rms_bts_in_net WHERE Step_Id='optimize')

解决方案

大家帮我看看 这个sql怎么改造能不报错

时间: 2024-09-20 20:16:30

merge select-merge insert select问题的相关文章

oracle merge和批量insert实操

create table small_customers (customer_id number, sum_orders number) ; create table medium_customers (customer_id number, sum_orders number) ; create table large_customers (customer_id number, sum_orders number) ; select * from small_customers ; sele

Hive基本操作,DDL操作(创建表,修改表,显示命令),DML操作(Load Insert Select),Hive Join,Hive Shell参数(内置运算符、内置函数)等

1.  Hive基本操作 1.1  DDL操作 1.1.1    创建表 建表语法 CREATE [EXTERNAL] TABLE [IF NOT EXISTS] table_name    [(col_name data_type[COMMENT col_comment], ...)] +    [COMMENT table_comment]    [PARTITIONED BY (col_namedata_type [COMMENT col_comment], ...)]    [CLUST

hive中:insert select limit 1 值变化

问题描述 hive中:insert select limit 1 值变化 hive 0.10.0中使用insert into xxx select a,b from zzz limit 1的方式向表xxx中插入数据.结果发现每次插入的数据都是不一样的. 然后单独测试select a,b from zzz limit 1 不论多少次,结果都是一样的. 求教,这是为什么?

JS排序方法(sort,bubble,select,insert)代码汇总_基础知识

最近开始学习数据结构. 一点一点整理,希望能坚持下来. 因为方向是前端,所以用JavaScript实现. //sort排序 var testArr1=[3, 44, 38, 5, 47, 15, 36, 26, 27, 2, 46, 4, 19, 50, 48]; var testArr2=[3, 44, 38, 5, 47, 15, 36, 26, 27, 2, 46, 4, 19, 50, 48]; var testArr3=[3, 44, 38, 5, 47, 15, 36, 26, 27

应用中抛出SELECT/UPDATE/INSERT/DELETE command denied to user 'XXX'@'XXX.XXX.XXX.XXX' for table 'xxx' 的5种原因

实为吾之愚见,望诸君酌之!闻过则喜,与君共勉  第一章 准备环境 创建数据测试数据 mysql> create database test1; Query OK, 1 row affected (0.00 sec)   mysql> create database test2; Query OK, 1 row affected (0.00 sec)   mysql> create database test3; Query OK, 1 row affected (0.00 sec)  

mysql中insert...select复制表数据

语法 INSERT INTO db1_name (field1,field2) SELECT field1,field2 FROM db2_name 实例 可以运行insert...select语法解决问题: insert into hotel_ktv (title,price, number,date,area,content,num) select title,price,number,date,area,content,num from hotel_ktv; 查看结果  代码如下 复制代码

C#的数据库操作 insert, select, delete, update

好说事~请看下面的接口定义:     代码如下 复制代码    /// <summary>     /// 数据库操作接口     /// </summary>     public interface HIDatabase     {     /// <summary>     /// 查找数据     /// </summary>     /// <param name="sql"/>需要执行的SQL语句     ///

sql insert select语句的使用方法

sql insert select语句的使用方法 INSERT 语句中的 SELECT 子查询可用于将一个或多个其它的表或视图的值添加到表中.使用 SELECT 子查询可同时插入多行. 下面的 INSERT 语句将 titles 中数据的 type 是 modern cooking 的所有行的数据插入到一个单独的表中: USE pubsINSERT INTO MyBooks   SELECT title_id, title, type   FROM titles   WHERE type = '

存储过程执行select与insert同一个表sql语句

存储过程执行select与insert同一个表sql语句 public void onedb_twoconnect()         {             using (transactionscope scope = new transactionscope())             {                 mysql教程connection conn1 = new mysqlconnection("server=127.0.0.1;database=test;uid=