I have 2 tables in Oracle DB and one table contains Column A, B and other table contains columns A, B, C. first two columns are same in both the tables, However, columns A, B in both tables have different data so A -> B relationship both tables is different.
So I want to run a query to fetch data which contains Table1 A, Table1 B, Table2C where Table1 B= Table2 B;
Select Tab1.A, Tab1.B, (select Tab2.C from Tab2 where Tab1.B=Tab2.B )
FROM Tab1 WHERE Tab1.A IN (1,2,3,4,5);