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: Query on previous row value

Re: Query on previous row value

From: Jeff Pope <popej_at_txbollweevil.org>
Date: 16 Apr 2002 07:01:46 -0700
Message-ID: <c51eda73.0204160601.1ecc306e@posting.google.com>


Works great with 8i. Any way to get the same results with 8.0.x?

Jeff

Richard Kuhler <noone_at_nowhere.com> wrote in message news:<mtHt8.36961$VQ2.18906108_at_twister.socal.rr.com>...
> Well, assuming the date span can't be more than 24 hours...
>
> select to_char(t_date, 'HH24:MI:SS'),
> to_char(to_date('01-jan-1900', 'dd-mon-yyyy')
> + (t_date - lag(t_date, 1) over (order by t_date))
> , 'HH24:MI:SS')
> from x
>
>
> Richard
>
> Jeff Pope wrote:
> >
> > Here's my problem. I need to generate a query that will display a date
> > field then the computed time lapse from the queries' previous row.
> >
> > T_DATE
> > -------
> > 11:34:17
> > 11:35:32
> > 11:42:32
> >
> > I need to display
> >
> > T_DATE TIME_LAPSE
> > ------- --------
> > 11:34:17 (null)
> > 11:35:32 00:01:15
> > 11:42:32 00:07:00
> >
> > Please advise. Thanks
> >
> > Jeff
Received on Tue Apr 16 2002 - 09:01:46 CDT

Original text of this message

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