`
winie
  • 浏览: 224265 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

Merge into bug?

 
阅读更多

在ORACLE 11.2.0.3上执行merge into 里面sql 入下形式:

merge into DCDW.t1 Target

    using (select Org_code Org_code,

                  BUSS_DATE,

                  BUSS_NO,

                 ...

             from (SELECT E.BUSS_NO BUSS_NO,

                          E.Org_code  Org_code,

                          ..

                     FROM DCDW.T E

                   

                    WHERE

                        E.MODIFIED_DATE >= IN_BEGIN_DATE

                      AND E.MODIFIED_DATE <= IN_END_DATE)

            group by  BUSS_NO,Org_code,BUSS_DATE) Source

    ON (Target.ORG_CODE = Source.Org_code and target.BUSS_TYPE = '1' AND target.BUSS_DATE = source.BUSS_DATE AND target.BUSS_NO = source.BUSS_NO)

    WHEN NOT MATCHED THEN

      INSERT

        ..

    WHEN MATCHED THEN

      UPDATE

         SET ..;

咋都会错误,在ORACLE 11.2.0.1上执行正常,修改以下sql,在各个版本执行都正常,唯一区别是max(org_code)

erge into DCDW.t1 Target

    using (select max(Org_code) Org_code,

                  BUSS_DATE,

                  BUSS_NO,

                 ...

             from (SELECT E.BUSS_NO  BUSS_NO,

                          E.Org_code  Org_code,

                          ..

                     FROM DCDW.T E

                   

                    WHERE

                        E.MODIFIED_DATE >= IN_BEGIN_DATE

                      AND E.MODIFIED_DATE <= IN_END_DATE)

            group by  BUSS_NO,BUSS_DATE) Source

    ON (Target.ORG_CODE = Source.Org_code and target.BUSS_TYPE = '1' AND target.BUSS_DATE = source.BUSS_DATE AND target.BUSS_NO = source.BUSS_NO)

    WHEN NOT MATCHED THEN

      INSERT

        ..

    WHEN MATCHED THEN

      UPDATE

         SET ..;

 

奇怪得很!make下!

分享到:
评论

相关推荐

    oracle使用 merge

    3. **处理`DBLINK`问题**:在跨数据库链接使用`MERGE`时,需要注意Oracle 10g中一个已知的bug(Bug ID 4311273),该bug可能导致ORA-02064错误。解决方法是确保`WHEN MATCHED THEN`和`WHEN NOT MATCHED THEN`两个...

    SQL Server使用Merge语句当源表数据集为空时,无法进行查询的问题

    1. `MERGE INTO` 目标表 AS 目标别名 2. `USING` 源表 AS 源别名 3. `ON` 连接条件(确定目标表和源表的匹配规则) 4. `WHEN MATCHED THEN UPDATE SET` 更新已匹配的行 5. `WHEN NOT MATCHED BY TARGET THEN INSERT`...

    myBase Desktop V7.0.0 B22 专业版

    Plugin: File - Maintenance - Merge database, for merging newer revisions from a specified .nyf database into the current database Enhancement: an option to display colorful labels; The color is ...

    simple-tags

    1. Unzip "Simple tags" archive and put all files into a folder like "/wp-content/plugins/simple-tags/" 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Inside the Wordpress admin, go ...

    OutlookAttachView v2.73

    * NK2Edit - Edit, merge and fix the AutoComplete files (.NK2) of Microsoft Outlook. Description =========== OutlookAttachView scans all messages stored in your Outlook, and displays the list of ...

    微软内部资料-SQL性能优化5

    Contents Overview 1 Lesson 1: Index Concepts 3 Lesson 2: Concepts – Statistics 29 Lesson 3: Concepts – Query Optimization 37 Lesson 4: Information Collection and Analysis 61 Lesson 5: Formulating ...

    a project model for the FreeBSD Project.7z

    Committers fall into three groups: committers who are only concerned with one area of the project (for instance file systems), committers who are involved only with one sub-project and committers who ...

    SmartSVN-reference

    2. **Import into Repository**:将本地文件或目录导入到代码库。 3. **Update**:从代码库获取最新的更改并应用到本地工作副本。 - **Update**:常规更新。 - **Update More**:递归更新子目录。 - **Update ...

    oracle script

    4. **DML语句**:如INSERT INTO,UPDATE,DELETE,以及MERGE语句用于数据的增删改操作。 5. **事务管理**:BEGIN,COMMIT,ROLLBACK语句用于控制数据库的事务,确保数据的一致性和完整性。 6. **游标**:在PL/SQL...

    WPTools.v6.29.1.Pro

    * - = bug fix * + = new feature * * = changed, expanded feature ******************************************* * IMPORTANT: Please edit file WPINC.INC to * activate WPREPORTER, WPSPELL, wPDF, TBX * and ...

    git常用命令

    git commit -m 'Merge refactor into dev12-18' ``` **说明:** - 在这里使用了一个合并提交,通常在解决完冲突之后,你需要重新提交来确认合并结果。 以上是Git的一些常用命令及其使用方法,通过掌握这些基本操作...

    opensc-0.12.0.tar.gz

    * PKCS#11 - Number of virtual slots moved into configuration. * PKCS#11 - Fix fork() compliance. * make sign_with_decrypt hack configureable for siemens cards. New in 0.11.4; 2007-09-10; Andreas ...

    8-07-14_MegaCLI for linux_windows

    SCGCQ00341724 Defect FW allows a firmware to be flashed through Online FW Update method in DOS and then breaks into montask SCGCQ00342848 Defect Add Adapter restart support in CLI SCGCQ00342993 Defect...

    macOS Unlocker 2.1 for VMware Workstation 11/12/14(VM14破解补丁)

    that file, you will need to merge them into the supplied local.sh file. 2. The unlocker needs to be re-run after an upgrade or patch is installed on the ESXi host. 3. The macOS VMwwre tools are no ...

Global site tag (gtag.js) - Google Analytics