Hello Guys,
I would really appreciate if you could help me in figuring out a solution to this problem I am facing:
We are on Oracle 11g Release 2.
Say, I have 3 tables A, B and C, all the 3 tables have the following columns with the exact same names:
data_load_time DATE
data_load_process VARCHAR2(100)
data_update_time DATE
data_update_process VARCHAR2(100)
And, also a foreign key - fkey NUMBER.
Now the requirement is - for a given fkey (say 100), I need to pull the latest time and process among the 3 tables, it doesn't matter whether
it's load or update columns, I just need 1 set of values, the max time and the corresponding process out.
Eg: Say for fkey = 100, I get the max time and the corresponding process from table A, then I get the max time and corresponding process from table B and then from table C, the final result should have the max time and the corresponding process out of the 3 values I just pulled out from the 3 tables separately.
Is there a efficient way of accomplishing this in just 1 query ?.
Thanks for your help.
-D