Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Compare current and next row data
<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