Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unable to use SUBSTR function while using left join in Oracle

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)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading