I need some alternate way of joining two tables on derived column.
Right now I am deriving a column and giving it some name and using this as an element to join to another table.
This table needs to be joined on derived column to get its corresponding code key.
case when claim_cd='A'
then XYZ||ABC end as dervd_col ,
from table1 A
left outer join table2 B on dervd_col=B.column
Is there any alternate way of coding this piece? There are already some sub queries in the view hence when I join on the derived column it is running into prod joins and finally running out of spool.
Hoping to recieve some help,
Derived tables and string operations usually end up in product join, what you can do is perhaps store a value of a derived column in a table and then use it as it is.
-- If you are stuck at something .... consider it an opportunity to think anew.