Suppose I have Table 1 and Table 2.
Table1 has (pkcol, Seq) as columns. Table2(pkcol, fkcol_from_Table1, details)
Ex:
Table1
| pkcol | seq |
|---|---|
| 10 | 1 |
| 20 | 2 |
| 30 | 7 |
| . | |
| . |
Table2
| pkcol | fkcol_from_Table1 | details |
|---|---|---|
| 100 | 10 | R1 |
| 101 | 10 | R2 |
| 103 | 20 | R1 |
| 104 | 30 | R4 |
| 105 | 30 | R2 |
Suppose my search criteria are R1 and R2, Then I want to get the details from Table 1 by joining Table 2. From the above example with the search criteria get only 100 and 101(pkcol) from Table 2 and using the foreign key join get "1" from Table 1.
Can I do this using a query in oracle sql?