[oracle]错误查询嵌套选择错误 ORA 00913

标签: ora-00913 sql Oracle
发布时间: 2017/4/15 18:53:10
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.

它不工作,我只有错误 ORA 00913:"的值太多"。

问题,我认为是用嵌套 select。我想要使用此选择以查看。

此代码显示报告的所有雇员。我改变了这篇文章的属性名称︰

 SELECT sk."AAAA", sk."BBBB", sk."CCCC", sk."DDD",
          sk."EEEE", sk."FFFF", sk."GGGGG",
          sk."HHHHH",
          (SELECT f.VALUE
           FROM fnd_user_property_tab f
           WHERE f.identity = sk.login
           AND NAME = 'IIIII') iii,sk."JJJJ",

           (SELECT f.VALUE
           FROM fnd_user_property_tab f
           WHERE f.identity = sk.login
           AND NAME = 'SMTP_MAIL_ADDRESS') mail,

           (SELECT f.VALUE
            FROM fnd_user_property_tab f
            WHERE f.identity = sk.login 
            AND NAME = 'KKKK') kkkk,

            (SELECT fnd.ORACLE_ROLE
             FROM fnd_user_role_tab fnd
             WHERE fnd.identity = sk.login
             AND fnd.ORACLE_ROLE LIKE 'STH-%') profil,

             (SELECT dr.ROLE, sox_co_w_roli(dr.role) skład
              FROM sys.dba_roles dr
              WHERE dr.role = (SELECT fnd.ORACLE_ROLE
                              FROM fnd_user_role_tab fnd
                              WHERE fnd.identity = sk.login  
                              AND fnd.ORACLE_ROLE LIKE 'STH-%')
             ) profile_role
    FROM sox_konta sk
    WHERE("PROFIL_DB" LIKE '%ppppp%'
          OR "PROFIL_DB" = 'oooooooo'
          OR "PROFIL_DB" = 'rrrrrrrr'
          )
    AND "COMPANIES" IN ('ZZ; ', 'YY; ')

解决方法 1:

尝试重写您以这种方式的选择

SELECT sk."AAAA", sk."BBBB", sk."CCCC", sk."DDD",
          sk."EEEE", sk."FFFF", sk."GGGGG",
          sk."HHHHH",
          f_iii.value iii, sk."JJJ",
          f_mail.value mail,
          f_kkk.value kkk,
          fnd.oracle_role profil,
          dr.ROLE, sox_co_w_roli(dr.role) skład
    FROM sox_konta sk,
         fnd_user_property_tab f_iii,
         fnd_user_property_tab f_mail,
         fnd_user_property_tab f_kkk,
         fnd_user_role_tab fnd,
         sys.dba_roles dr
    WHERE("PROFIL_DB" LIKE '%ppppp%'
          OR "PROFIL_DB" = 'oooooooo'
          OR "PROFIL_DB" = 'rrrrrrrr'
          )
        AND "COMPANIES" IN ('ZZ; ', 'YY; ')
        AND f_iii.identity = sk.login
        AND f_iii.NAME = 'IIIII'
        AND f_mail.identity = sk.login
        AND f_mail.NAME = 'SMTP_MAIL_ADDRESS'
        AND f_kkk.identity = sk.login
        AND f_kkk.NAME = 'KKKK'
        AND fnd.identity = sk.login
        AND fnd.ORACLE_ROLE LIKE 'STH-%'
        AND dr.role = fnd.ORACLE_ROLE;

我认为这将帮助。

赞助商