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

Home -> Community -> Usenet -> c.d.o.tools -> SQL subquery: dealing with the maximum effective date

SQL subquery: dealing with the maximum effective date

From: <crunchy2k_at_my-deja.com>
Date: Mon, 18 Dec 2000 01:25:59 GMT
Message-ID: <91jp34$l0u$1@nnrp1.deja.com>

I have a table with fields of

        SSN
        record_num (1, 2, etc.)
        effdt
        status ('active', 'inactive')
        ... and other fields

Conceptually, I know that each SSN has one maximum effdt with status = active, when I look across all of its record_num's.

For each SSN, I want the SSN/record_num combinations that were active on that one maximum effdt that was active.

Can someone give me a SQL query for this? I am guessing it entails a subquery within another subquery.

Thanks.

Sent via Deja.com
http://www.deja.com/ Received on Sun Dec 17 2000 - 19:25:59 CST

Original text of this message

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