Home > OS >  Unable to use SUBSTR function while using left join in Oracle
Unable to use SUBSTR function while using left join in Oracle

Time:08-31

Please I am trying to execute the below query and i keep getting the error

ORA-00904: "B"."SUBSTR": invalid identifier

select A.column1,B.SUBSTR(TRAN_REF,11,10),A.column2,B.column1,B.column2
from Table1 A
left join Table2 B
on A.column1= B.SUBSTR(SRC_TRAN_REF,11,10)

CodePudding user response:

The table alias is part of the column, not of the function name:

select A.column1,SUBSTR(B.TRAN_REF,11,10),A.column2,B.column1,B.column2
from Table1 A
left join Table2 B
on A.column1= SUBSTR(B.SRC_TRAN_REF,11,10)
  • Related