I need help.
I have three tables, CROSSREF, NAMEREF and EMPREF defined with these fields:
EMPREF contains EMPID, VERSION and MGRCODE
CROSSREF contains EMPID and NAMEID
NAMEREF contains NAMEID, FULLNAME
What I need to do is to pull out all the employees with MGRCODE = '1' and then pull out all the FULLNAME values from NAMEREF. The NAMEREF is taken from crossreferencing the CROSSREF table with the EMPID to get a NAMEID. To make things worse, the VERSION field is a timestamp where there could be more than one VERSION of the same employee. I only need the latest one.
I'm not really sure how to do this... Is it a simple Union or a join? And how do I deal with the VERSION, is there a way to get the most recent one?
Please help!
Start Free Trial