Get the error invalid identifier in the left outer join

I wrote a query and get the invalid identifier error during execution:
the exact error is: ORA-00904: "D". "" ACCT_NO ": invalid identifier
This query is not able to access the parent table alias in the subquery of the left outer join.

This is the query:
SELECT D.PROD_DESC_TX, BASE. ASSET_NUM, BASE. PROD_ID, BASE.NAME
OF TABLE1 D
LEFT OUTER JOIN
(
SELECT ASSET_NUM, PROD_ID, B.SID
FROM TABLE2 E
JOIN IN-HOUSE TABLE3 HAS IT E.PROD_ID = A.ROW_ID
JOIN INTERNAL TABLE 4 C ON A.PAR_PROD_INT_ID = C.ROW_ID
INTERNAL TABLE5 JOIN B ON C.ROW_ID = B.PAR_ROW_ID
AND B.TYPE = 'VALUE '.
AND B.NAME = 'VALUE '.
WHERE E.ASSET_NUM = ((CASE WHEN LTRIM (RTRIM (D.BANK_NO)) = '021 ' THEN '021' ELSE ' 020' END) |) LTRIM (RTRIM (D.APPL_CD)). LTRIM (RTRIM (D.ACCT_NO)))
) BASE ON ((CASE WHEN LTRIM (RTRIM (D.BANK_NO)) = '021 ' THEN '021' ELSE ' 020' END) |) LTRIM (RTRIM (D.APPL_CD)). LTRIM (RTRIM (D.ACCT_NO))) = BASE. ASSET_NUM
WHERE D.BANK_NO = 'VALUE '.
AND D.APPL_CD = 'VALUE '.
AND D.ACCT_NO = 'VALUE '.

Edited by: user648525 13 Sep, 2011 01:21

I can easily look at your request at this time (using my iPhone on a train).

But trying out this line in the WHERE (the one with the invalid reference) clause in the main query.

Who is... in the view of inline, use only the logic of the join (the clauses).

Overflow the filtering logic (WHERE clause) to the main request. You may need to select some additional inline view columns to make these references work.

Tags: Database

Similar Questions

  • Modeling of the left outer join

    Hello world

    I'm tender hand to you guys for a modeling help

    I have a FACT, the customers, the Dim_Date and CUST_ADDRESS of tables to model

    Fact and the client are joined through CUST_ID

    FACT and DATE are joined through DATE_ID

    CUST_ADDRESS must be attached to the top of the model through CUST_ID, DATE_ID and this join must be Left outer because sometimes the address does not exist or is not current, which means DATE_ID could be different between Dim_Date and CUST_ADDRESS

    If it were to join internal, model would have been easy, because of the outside left that I am unable to model, it's pretty good.

    Application under
    Select D.DATE, C.CUST_NAME, CA. ADDRESS, F.AMOUNT
    Of
    F FACT
    JOIN THE
    CUSTOMER C
    ON C.CUST_ID = F.CUST_ID
    JOIN THE
    DIM_DATE D
    ON F.DATE_ID = D.DATE_ID
    LEFT OUTER JOIN
    CUST_ADDRESS CA
    ON C.CUST_ID = CA. CUST_ID AND C.DATE_ID = D.DATE_ID

    Thanks in advance

    When I add the CUSTOMER and in FACT LTS CUST_ADDRESS

    Stop it!

    Don't add CUSTOMER and CUST_ADDRESS in the FACT of LTS. Why would add you to the LTS DO?

    You design a management model: CUSTOMER is a dimension and it has its own logical table this logic table join with a logical join in the activity diagram. Ditto for CUST_ADDRESS.

    So the change, I missed earlier is CUST_ADDRESS contains no Cust_ID (ACTUALLY existing), but contains a Cust_NO, and the table to translate Cust_NO in Cust_ID is CUSTOMER?

    No problem...

    Let's start with a new alias of CUSTOMER (to keep more simple to understand at the moment), call as you want, but this new alias will be the link between the FACT and CUST_ADDRESS.

    In LTS of the dimension 'Address', you have CUST_ADDRESS initially, add an inner join on the new alias that you created in the LTS of the CUSTOMER. So now your 'Address' logical dimension contains the Cust_NO and Cust_ID and this will make the join to FACT.

    Between CUST_ADDRESS and the CLIENT, you can keep an inner join, because the target is not not for get the address of the customer, but is having the Cust_ID in the address line.

    Give it a try at that.

    But do not add these tables in the LTS, they are logical dimensions.

  • He had to know the right outer join using...

    He had to know the right outer join using...

    For example: first query left outer join for the emp table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the E.DEPTNO = D.DEPTNO)

    Second query left outer join for the Dept table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the D.DEPTNO = E.DEPTNO)

    In the example above I just Exchange where condition condition to get an outer join of two table with a left outer join itself. Wat is use right outer join, instead, I can swap the status of table name for the result. Please suggest...

    Hello

    chan001 wrote:

    He had to know the right outer join using...

    For example: first query left outer join for the emp table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the E.DEPTNO = D.DEPTNO)

    Second query left outer join for the Dept table: SELECT EMPNO, ENAME, D.DEPTNO FROM EMP E, Department D WHERE the D.DEPTNO = E.DEPTNO)

    In the example above I just Exchange where condition condition to get an outer join of two table with a left outer join itself. Wat is use right outer join, instead, I can swap the status of table name for the result. Please suggest...

    The two examples above use the old syntax outer join of Oracle. (I guess there should be a sign inside the parentheses, e.g.. +)

    ...  WHERE E.DEPTNO = D.DEPTNO (+)

    )

    The LEFT OUTER JOIN and RIGHT OUTER JOIN terms apply only to the ANSI join syntax, e. g.

    .

    .. FROM EMP E

    DEPT LEFT OUTER JOIN D ON E.DEPTNO = D.DEPTNO

    As Blushadow said above, there's no real point in having LEFT OUTER JOIN and RIGHT OUTER JOIN;  What you can do with one (or a combination of both) can be done with the other.  Most people use LEFT OUTER JOIN systematically and never use RIGHT OUTER JOIN.

    There are situations where using a combination of the two would mean a little less striking, but only a little less and this kind of situation is very common, and one may wonder if the somewhat shorter code is more specific.  I suggest that forget you RIGHT OUTER JOIN.

  • Left Outer Join help...

    Hello world

    I'm still trying to learn the SQL, and I can not specifically with the left outer join.  I normally join tables using equijoin, but I don't get the right data set returns, and designed with the help of a left or right outer join would solve the problem...

    Here is my SQL that works properly with 1 left outer join.  I build the slow query in the SQL following, you will see where I see the error.  I don't expect you to understand the data and the columns, I'm trying to join, I think the problems I encounter are related to syntax, and I hope that you can find where are my syntax errors.

    Select

    s.Name as "Pseudonym,"

    SV.view_name as "name of the view.

    s_view. Name

    Of

    s s_screen,

    s_screen_view sv

    outer join left s_view

    WE (sv.view_name = s_view.name)

    where

    SV.screen_id = ' 1-866 A - 1X3LU' and

    s.ROW_ID = sv.screen_id and

    s.repository_id = ' 866 A-1-1"and

    s_view.repository_id = ' A-1-1 866 ";

    Here is the SQL code where I encounter the following error...

    Error:

    ORA-00904: "SV". "" View_name ": invalid identifier

    00904, 00000 - '% s: invalid identifier '.

    * Cause:

    * Action:

    Error on line: column 14: 7

    Problematic SQL:

    Select

    s.Name as "Pseudonym,"

    SV.view_name as "name of the view.

    s_view. Name,

    s_applet. Name as Applet

    -b.SID like "name of the cmdlet.

    Of

    s s_screen,

    s_screen_view sv,

    wti s_view_wtmpl_it

    outer join left s_view

    WE (sv.view_name = s_view.name)

    outer join left s_applet

    WE (wti.name = s_applet.name)

    where

    SV.screen_id = ' 1-866 A - 1X3LU' and

    s.ROW_ID = sv.screen_id and

    s.repository_id = ' 866 A-1-1"and

    s_view.repository_id = ' A-1-1 866 ";

    Thanks in advance for your help.

    Chris

    > ORA-00904: "S_VIEW_WEB_TMPL." "" ROW_ID ": invalid identifier

    I don't see this table in your FROM clause.

  • Problem with XMLTABLE and LEFT OUTER JOIN

    Hi all.

    I have a problem with XMLTABLE and LEFT OUTER JOIN, in 11g it returns the correct result, but in 10g it doesn't, it is illustrated as a INNER JOIN.
    SELECT * FROM v$version;
    
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    --test for 11g
    
    CREATE TABLE XML_TEST(
         ID NUMBER(2,0),
         XML XMLTYPE
    );
    
    INSERT INTO XML_TEST
    VALUES
    (
         1,
         XMLTYPE
         ('
              <msg>
                   <data>
                        <fields>
                             <id>g1</id>
                             <dat>data1</dat>
                        </fields>
                   </data>
              </msg>
         ')
    );
    
    INSERT INTO XML_TEST
    VALUES
    (
         2,
         XMLTYPE
         ('
              <msg>
                   <data>
                        <fields>
                             <id>g2</id>
                             <dat>data2</dat>
                        </fields>
                   </data>
              </msg>
         ')
    );
    
    INSERT INTO XML_TEST
    VALUES
    (
         3,
         XMLTYPE
         ('
              <msg>
                   <data>
                        <fields>
                             <id>g3</id>
                             <dat>data3</dat>
                        </fields>
                        <fields>
                             <id>g4</id>
                             <dat>data4</dat>
                        </fields>
                        <fields>
                             <dat>data5</dat>
                        </fields>
                   </data>
              </msg>
         ')
    );
    
    SELECT
         t.id,
         x.dat,
         y.seqno,
         y.id_real
    FROM
         xml_test t,
         XMLTABLE
         (
              '/msg/data/fields'
              passing t.xml
              columns
                   dat VARCHAR2(10) path 'dat',
                   id XMLTYPE path 'id'
         )x LEFT OUTER JOIN
         XMLTABLE
         (
              'id'
              passing x.id
              columns
                   seqno FOR ORDINALITY,
                   id_real VARCHAR2(30) PATH '.'
         )y ON 1=1
    ;
    
    ID     DAT     SEQNO     ID_REAL
    --     -----     -----     -------
    1     data1     1     g1
    2     data2     1     g2
    3     data3     1     g3
    3     data4     1     g4
    3     data5          
    This is all nice, now the problem:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
    PL/SQL Release 10.2.0.1.0 - Production
    "CORE     10.2.0.1.0     Production"
    TNS for HPUX: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    
    --exactly the same environment as 11g (tables and rows)
    SELECT
         t.id,
         x.dat,
         y.seqno,
         y.id_real
    FROM
         xml_test t,
         XMLTABLE
         (
              '/msg/data/fields'
              passing t.xml
              columns
                   dat VARCHAR2(10) path 'dat',
                   id XMLTYPE path 'id'
         )x LEFT OUTER JOIN
         XMLTABLE
         (
              'id'
              passing x.id
              columns
                   seqno FOR ORDINALITY,
                   id_real VARCHAR2(30) PATH '.'
         )y ON 1=1
    ;
    
    ID     DAT     SEQNO     ID_REAL
    --     -----     -----     -------
    1     data1     1     g1
    2     data2     1     g2
    3     data3     1     g3
    3     data4     1     g4
    As you can see in 10g that I don't have the last row, it seems that Oracle 10 g does not recognize the LEFT OUTER JOIN.

    Is this a bug?, Metalink says that sometimes we can have an ORA-0600, but in this case there is no error results returned, just incorrect.

    Help, please.

    Kind regards.

    What about try the original Oracle method for outer joins? Using (+) without the extra space

    XMLTABLE(...COLUMNS ... id XMLTYPE PATH ... ) x,
    XMLTABLE(... PASSING x.id ...) (+) y
    
  • Show all dates between date range (time Dimension is left outer join)

    All,

    I did some research on this issue, but in all positions on date variables, date prompts and date filtering I have not seen one exactly to my question (perhaps that they are and I don't have my head around it properly yet).

    My requirement of report is to allow a user to select a start date and an end of day. The report is expected to show the activity of these two days - AND display 0/null on days where there is no activity. This second part is where I am getting hung up.

    The paintings in question are:
    Timedim
    EventFact
    CustomerDim

    My MDB is configured as follows:
    Left outer join of Timedim EventFact
    Inner join CustomerDim EventFact

    If I run a report by selecting the DAYS of Timedim and an EventFact measure1 with range day 01/01/2010-31/12/2010... A record for each day and it looks perfect because of the left outer join between Timedim and CustomerDim.

    But... If I add a CustomerDim field, Select TimeDim.DAY, CustomerDim.CUSTNAME, EventFact.MEASURE1, OBIEE returns only records for the days that have record EventFact.

    This is due to the fact that the Timedim is always external joined in EventFact, but adding in fact CustomerDim OBIEE set up an inner join between tables that will only return data where there are data EventFact.

    There is a way around it in this simple case, and that is to define the relationship between CustomerDim and EventFact as an outer join as well. This will give the desired effect (but an outer join between the two tables is not the real relationship) and I have add an extra dimension and add additional sources of logic to a single dimension in MDB it becomes complicated and messy.

    Also, ive ruined with the definition of the conduct in the relationship table, etc... but he gave not the desired effect.

    Has anyone ever met the need for force display all dates within a range specified with a fact table that does not have an entry for each date?

    Thanks in advance.

    K

    Published by: user_K on April 27, 2010 11:32

    Hi there, the easiest way is to the LTS himself. Double-click your LTS, go to the tab with the column mappings. Make sure you have checked "show no mapped" column.

    You should see your new dummy column in the list, in the central part of mapping (IE not the right) just enter 0, or launch the expression editor and enter 0 in there.
    simple!

  • Left Outer Join with sum

    Dear elders,



    Firstly, sorry if my question is considered to be 'very novice' but I have this problem of confusion.

    Can I use the left outer join with summary?
    For example:

    Work table
    JobCode      JobGroupCode      
    111A         1100              
    112B         1100               
    113C         1100
    121A         1200
    333F         3300               
    Table No.
    JobGroupCode    ParentCode
    1100            1000
    1200            1000
    1300            1000
    3300            3000
    Activity table
    Jobcode      Mandays
    111A         5
    112B         7
    113C         3
    I want to choose with this result
    Job.JobCode    Job.JobGroupCode     JobGroup.Parentcode       Mandays
    111A           1100                 1000                      5
    112B           1100                 1000                      7               
    113C           1100                 1000                      3
    121A           1200                 1000                      0
    333F           3300                 3000                      0
    All I did was:
    select j.jobcode, j.jobgroupcode, jg.parentcode, sum(a.mandays)
      from job j
     inner join jobgroup jg on j.jobgroupcode = jg.jobgroupcode
      left join activity a on j.jobcode = a.jobcode
     group by j.jobcode, j.jobgroupcode, jg.parentcode
    and I got was only jobcode activity table, not exactly what I want to get all the work table jobcode. Could you please tell me, where I was wrong?

    result
    Job.JobCode    Job.JobGroupCode     JobGroup.Parentcode       Mandays
    111A           1100                 1000                      5
    112B           1100                 1000                      7               
    113C           1100                 1000                      3
    Thank you very much.

    Published by: user11197113 on May 25, 2009 03:31

    Published by: user11197113 on May 25, 2009 03:32

    Hello (and welcome!).

    Edit

    OK, try this:

    select j.jobcode, j.jobgroupcode, jg.parentcode, NVL(sum(a.mandays),0)
      from job j
     inner join jobgroup jg on j.jobgroupcode = jg.jobgroupcode
      left join activity a on j.jobcode = a.jobcode
     group by j.jobcode, j.jobgroupcode, jg.parentcode
    

    That will give you this:

    JOBC JOBG PARE SUM(A.MANDAYS)
    ---- ---- ---- --------------
    111A 1100 1000              5
    112B 1100 1000              7
    113C 1100 1000              3
    121A 1200 1000              0
    333F 3300 3000              0
    

    These are real results of your test data.

  • Using Left Outer Join with reference

    I have three tables.
    Table 1: BOOK_DETAILS
    Fields: BOOK_ID, BOOK_NAME

    Table 2: BOOK_ISSUE_RECORD
    Fields: BOOK_ID, USER_NAME

    Table 3: BOOK_AUTHOR
    Fields: BOOK_ID, AUTHOR_NAME

    I must link table 1 and table 2 with a left outer join, because even if the book is not the questions to anyone, his name should come.
    I have once again display the name of the author of books for each book.
    I am able to create a query with the left outer join between table 1 and table 2. However, I am not able to give a reference to Table 3.
    Can someone help me with this please.

    Concerning
    Hawker
    select  d.book_name,
            a.book_author,
            i.user_name
      from       book_details d
            join
                 book_author a
              on (d.book_id = a.book_id)
            left join
                 book_issue_recors i
              on (d.book_id = i.book_id)
    /
    

    SY.

  • I'm trying to timestamp (RFC 3161) a pdf file using my own timestamp server equipment but still get an error: 'invalid certificate for use.

    I'm trying to timestamp (RFC 3161) a pdf file using my own timestamp server equipment but still get an error: 'Invalid certificate for use' (text Original - certificado valido para uso e nao pt_BR:O). How can I get more information on what I'm missing or whats wrong with the certificate?

    I found the answer to my problem: it was linked to the plug of the TSA and its attribute 'Extended Key use '.

    In any case, thanks for your help. Just to answer the questions:

    Version: Adobe Reader XI

    Tried both:

    (A) the time stamp for the signature: signature put under without timestamp and an alert

    (B) the document timestamp: no changes and an alert

  • Oracle: Use LEFT OUTER JOIN, but convert the data to an external list

    Hello, all,.

    I know it can be done; I just don't remember how I got it done, oh there are so many years.

    Assumes that the tables exist for groups and individuals.  People can belong to several groups.

    SELECT g.groupName, p.lastName || ', ' || p.firstName as fullName
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON gpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    ORDER BY g.groupName, fullName
    

    This gives us:

    Group One          Alpha, Daniel
    Group One          Bravo, Charles
    Group One          Charlie, Chuck
    Group Two          Beta, Alpha
    Group Two          Delta, Bonnie
    Group Three        Echo, Bunny
    Group Three        Golf, Samuel
    Group Three        November, Stan
    

    How word the SQL to get the data as:

    Group One          Alpha, Daniel | Bravo, Charles | Charlie, Chuck
    Group Two          Beta, Alpha | Delta, Bonnie
    Group Three        Echo, Bunny | Golf, Samuel | November, Stan
    

    V/r,

    ^_^

    I finally thought to it.  I was using incorrect keywords on Google.

    SELECT g.groupName, LISTAGG(p.lastName || ', ' || p.firstName,' | ') WITHIN GROUP (ORDER BY g.groupName) "fullName"
    FROM groups g LEFT OUTER JOIN groupPersonAssociation gpa ON ggpa.groupID = g.groupID
                  LEFT OUTER JOIN person p ON p.personID = gpa.personID
    GROUP BY g.groupName
    ORDER BY g.groupName, fullName  
    

    Just in case someone else is going through this same desire.

    HTH,

    ^_^

  • How can I get the most out of my battery?

    This video can help get the most out of your laptop battery.

    I hope this video helps to get the most out of the battery.

  • Why can't I get the most out of these numbers?

    I want to get the most out of a list of numbers (see attachment). However, when I use the Min & Max table vi, the maximum output gives nothing. My guess is that there is something wrong with the data format, but I'm having trouble understanding how I can solve this problem. Thanks for your help!

    Use a loop FOR and Unbundle.

  • How to get the computer out of safe mode of power

    How to get the computer out of safe mode of power

    Hello jeffg56,

    I understand that you want to leave safe mode, follow the steps below:

    Exit Safe Mode:

    1. Click Start, type msconfig in the search field and press ENTER to open the System Configuration window.

    2. On the general tab of the System Configuration window, select Normal startup, and then click OK.

    I hope this has been helpful, please let me know if you need more help.

    Thank you

  • left outer join and the where clause for the table to the right

    I want to join two tables a and b, where a is a must and b is a result set in option. When I use a left outer join to a to b, I want to achieve:

    1. Select a single column, two columns of b (not the join columns)
    2 - even if theres no friendly on the join column does not return data from one.
    3. If there is a match applies when the criteria on column b (table in option)

    so, how can I avoid no_data_found in this case? When I apply where criteria for b, so it does not return the data from one, which is a must.

    Sounds like a regular outer join to me...

    select a.col1, b.col2, b.col2
    from   tableA a
           left outer join tableB b
           on (a.id = b.id and b.colX = 'X')
    
  • What is the difference between NOT IN and LEFT OUTER JOIN

    Hello

    I searched the difference between everywhere. But his powerlessness.
    Please tell me the differences.

    Thanks in advance
    KVB

    It's like comparing apples and oranges.

    NOT IN - exclude all lines matching the condition NOT IN (beware of NULL values).

    JOIN EXTERNAL - return of rows from the inner table even if there is no corresponding row in the outer table.

    SQL> -- NOT IN
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  where  col1 not in (1,2);
    
          COL1
    ----------
             3
    
    SQL> -- NOT IN (subquery)
    SQL>
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  where  col1 not in (select col1 from y);
    
          COL1
    ----------
             2
             3
    
    SQL> -- OUTER JOIN
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  left outer join
     10         y
     11  on x.col1 = y.col1;
    
          COL1       COL1
    ---------- ----------
             1          1
             3
             2
    
    SQL> -- Maybe it helps to contrast LOJ with just JOIN?
    SQL> with x as
      2  (select 1 col1 from dual union all
      3   select 2 col1 from dual union all
      4   select 3 col1 from dual)
      5  ,    y as
      6  (select 1 col1 from dual)
      7  select *
      8  from   x
      9  join   y
     10  on x.col1 = y.col1;
    
          COL1       COL1
    ---------- ----------
             1          1
    
    SQL> 
    

Maybe you are looking for