Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help needed to find minimum in a series
On 18 abr, 11:43, Sandy80 <svarshneym..._at_gmail.com> wrote:
> I think I have not been able to explain my question well enough. I
> will try one more time.
>
> In table 1 which is the current table the userid 1234 has his status
> as A001, so we need to look for the max date of his status A001 in
> table 2.
> Then reading backwards we need to find out which is the minimum date
> for that status in table 2 without the break in status.
> So for 1234 his max date for A001 in table 2 is 01/01/2007, then
> reading backwards we go to 01/01/2006 and that is the minimum date for
> that status because for 01/01/2005 his status was B001 and not A001.
>
> Help please!!!
It is more clear now! ;-)
Take a look at analytics (LAG/LEAD) with MAX(). It should do the trick...
HTH Cheers.
Carlos. Received on Wed Apr 18 2007 - 05:28:45 CDT
![]() |
![]() |