On 7 May, 18:50, "ame...@[EMAIL PROTECTED]
" <ame...@[EMAIL PROTECTED]
> wrote:
> Thanks for the feedback Mark. =A0Say I have this data:
>
> Customer Id =A0 =A0 =A0Action Date =A0 =A0 Status
> ---------------------------------------
> 12345678 =A0 =A0 =A0 =A012/01/2005 =A0 =A0 =A0 Active
> 12345678 =A0 =A0 =A0 =A003/01/2005 =A0 =A0 =A0 Inactive
> 12345678 =A0 =A0 =A0 =A001/01/2005 =A0 =A0 =A0 Active
> 24568123 =A0 =A0 =A0 =A011/15/2005 =A0 =A0 =A0 Inactive
> 33445566 =A0 =A0 =A0 =A003/01/2006 =A0 =A0 =A0 Active
> 32548798 =A0 =A0 =A0 =A002/28/2005 =A0 =A0 =A0 Active
> 77777733 =A0 =A0 =A0 =A002/15/2005 =A0 =A0 =A0 Inactive
> 77777733 =A0 =A0 =A0 =A002/01/2005 =A0 =A0 =A0 Active
>
> Now, basically I want to ignore row# 5 as it falls outside my range.
> I also want to ignore row 4 as his status is inactive.
> I want to include rows 6 as he is active, and row 1, as his MAX date
> shows him active.
>
> That is the key, that his MAX date still shows him active.
> Row #7 will be ignored because his MAX date shows him as inactive....
>
> Does that make more sense? =A0And, we are on 10g R2....
>
> Thanks again!
>
> John
As Mark said, post the relevant CREATE TABLE script, together with an
INSERT script to populate the table and someone will be more inclined
to help with your query.
HTH
-g


|