Hi,
I have three tables T1, T2, T3, T4
T1 has a column rec_no
T2 has columns rec_no, prev_rec_no, origin
T3 has columns main_rec_no and sub_rec_no
T4 has columns rec_no, reference
For value of rec_no in T1, I have to fetch prev_rec_no from T2(where rec_no = rec_no in T1) and the corresponding reference from T4(where rec_no = prev_rec_no in T2)
But if the origin has a value of 'AAAA' in T2(for rec_no = rec_no in T1) then I will have to goto T3 and get the main_rec_no (where sub_rec_no = rec_no in T1) and then the corresponding reference from T4(for rec_no = main_rec_no in T3).
Can anyone pls help ASAP.
Thanks in advance.
I have three tables T1, T2, T3, T4
T1 has a column rec_no
T2 has columns rec_no, prev_rec_no, origin
T3 has columns main_rec_no and sub_rec_no
T4 has columns rec_no, reference
For value of rec_no in T1, I have to fetch prev_rec_no from T2(where rec_no = rec_no in T1) and the corresponding reference from T4(where rec_no = prev_rec_no in T2)
But if the origin has a value of 'AAAA' in T2(for rec_no = rec_no in T1) then I will have to goto T3 and get the main_rec_no (where sub_rec_no = rec_no in T1) and then the corresponding reference from T4(for rec_no = main_rec_no in T3).
Can anyone pls help ASAP.
Thanks in advance.