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: Compare current and next row data

Re: Compare current and next row data

From: Dmitry E. Loginov <lde_at_mpsb.ru>
Date: Thu, 2 Jun 2005 15:24:27 +0400
Message-ID: <d7mq7f$2j0j$1@news.caravan.ru>

<me_at_csgoh.com> wrote in message
news:1117699531.304670.88710_at_g44g2000cwa.googlegroups.com...
> Hi!
>
> Is there a way to compare data from two row (current and next row) of
> data in Oracle by just one SQL statement?
>
> I have a table looks like this
>
> f1 f2
> ------------------- ----
> 2005 06 01 14:30:00 100
> 2005 06 01 14:37:21 120
>
> How can I compare the time differences betwen 1st and 2nd rows by just
> using one SQL statement.

You can use analytic function LAG

>
>
> Appreciate you help. Thanks
>
> Bob
>
Received on Thu Jun 02 2005 - 06:24:27 CDT

Original text of this message

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