I have a table1 suppose ABC from which I am getting an o/p from a column like 'MYname_GKS_50' . I want only MYname part of that result to be used as a condition to fetch another column of different table. Suppose If i give columnname = MYname from table2.xyz . These 2 queries should be in a single SQL query in OracleDB. e.g:
Table1 (col1 , col2)
col2 has data MYname_GKS_50,MYname_GKS_51, MYname_GKS_52 , Ora_10, Ora_11...
i want col2 results only the MYname_GKS and Ora part for my search condition , the changing nos are not required.
- Table2 (Col3, col4)
the value from col2 i.e. MYname_GKS and Ora should be now compared with col3 of table2. if it matches, it should give me the col4 of the table2.
Any suggestions gurus!