Hi All, I am struggling to create a query based on following requirement. Please help
For example I have four tables looking like this:
A_Master(Table1)
A_Master_ID BIGINT primary key
A_Column1
B_Master(Table2)
B_Master_ID BIGINT primary key
A_Master_ID BIGINT FK references A_Master(A_Master_ID)
B_Column1
C_Master(Table3)
C_Master_ID BIGINT primary key
B_Master_ID BIGINT FK references B_Master(B_Master_ID)
C_Column1
D_Master(Table3)
D_Master_ID BIGINT primary key
C_Master_ID BIGINT FK references C_Master(C_Master_ID)
D_Column1
Now the requirement is , At any point of time we will get only One Key value filled (i.e either A_Master_ID or B_Master_ID or C_Master_ID or D_Master_ID ) and based on that Key value I need to return all the matched data from All five tables. Please help on doing this.
Regards,
Mohan