Query issue

  • From: "Manjula Krishnan" <oradba.la@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Mon, 5 Feb 2007 17:14:26 -0600

This query is driving me crazy. I know I am missing something simple here:

select e.employee, mrev.next_review
from employee e
         ,(select r.employee, max(r.next_review) as next_review
            from review r
            group by r.employee) mrev
where e.emp_status not in ('T', 'X', 'XX')
and e.employee = mrev.employee(+)

Employees have multiple rows in the review table and not all employees are
in the review table. I need to get the latest next_review, which I am
getting from the query.

But, how do I get the corresponding next_rev_code for this employee which is
also in the review table?

Thanks,

Manjula

Other related posts: