Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Query issue

Query issue

From: Manjula Krishnan <oradba.la_at_gmail.com>
Date: Mon, 5 Feb 2007 17:14:26 -0600
Message-ID: <9c92486f0702051514n29a99852w78bcd5f916d162d5@mail.gmail.com>


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

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Feb 05 2007 - 17:14:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US