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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Help needed to find minimum in a series

Re: Help needed to find minimum in a series

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 18 Apr 2007 03:28:45 -0700
Message-ID: <1176892125.876798.89100@d57g2000hsg.googlegroups.com>


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

Original text of this message

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