Help with an Oracle Error...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas DeMaio
    New Member
    • Jan 2011
    • 3

    Help with an Oracle Error...

    When I run the Querry below, I get the following error...

    S0022(904)[Microsoft][ODBC driver for Oracle][Oracle]ORA-00904: "DEPOSIT_ITEM_A MT": invalid identifier (0.13 secs)

    Can anyone tell me where my error is...

    Thanks...


    SELECT D.DEPOSIT_ID, D.DEPOSIT_DT, D.EXPECTED_DEPO SIT_AMT,
    I.DEPOSIT_ID, I.DEPOSIT_ITEM_ DT, I.DEPOSIT_ITEM_ AMT
    FROM ST2_REINSARAP.D EPOSIT D

    FULL JOIN

    (SELECT DEPOSIT_ID, DEPOSIT_ITEM_DT , SUM(DEPOSIT_ITE M_AMT)
    FROM ST2_REINSARAP.D EPOSIT_ITEM
    GROUP BY DEPOSIT_ID, DEPOSIT_ITEM_DT ) I

    ON D.DEPOSIT_ID = I.DEPOSIT_ID

    WHERE

    NVL(D.DEPOSIT_I D,0) <> NVL(I.DEPOSIT_I D,0) OR
    NVL(DEPOSIT_DT, '0001-01-01') <> NVL(DEPOSIT_ITE M_DT,'0001-01-01') OR
    NVL(EXPECTED_DE POSIT_AMT,0) <> NVL(DEPOSIT_ITE M_AMT,0)
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You don't have DEPOSIT_ITEM_AM T in your subquery. You have SUM(DEPOSIT_ITE M_AMT).

    Comment

    • Brian Connelly
      New Member
      • Jan 2011
      • 103

      #3
      I would check the column types again. The error is pointing to the column DEPOSIT_ITEM_AM T. This is caused by either the column does not exist. Im not sure but it could be caused by the joining of the columns where you are using the SUM function for DEPOSIT_ITEM_AM T and your selected join is DEPOSIT_ITEM_AM T. These could be resulting in an alias mistaken. Im not an expert on this though...just finished up a database course.

      Comment

      • Thomas DeMaio
        New Member
        • Jan 2011
        • 3

        #4
        Thanks!....

        I changed SUM(DEPOSIT_ITE M_AMT) to SUM(DEPOSIT_ITE M_AMT) as DEPOSIT_ITEM_AM T and it works...

        Comment

        Working...