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

Home -> Community -> Usenet -> c.d.o.server -> Re: Need help with SQL

Re: Need help with SQL

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 11 Jul 2002 20:58:36 GMT
Message-ID: <3D2DF14A.1A6DA729@exesolutions.com>


Philip Kuan wrote:

> Hi All,
>
> We are using Oracle 8.
>
> I have a table like this:
>
> Ernty_Time
> ----------
> 7/1/2002
> 7/3/2002
> 7/4/2002
> 7/8/2002
> 7/9/2002
> 7/11/2002
>
> The query results should look like this:
>
> Entry_Time Value (next entry_time - previous entry_time)
> ---------- -----
> 7/1/2002 2
> 7/3/2002 1
> 7/4/2002 4
> 7/8/2002 1
> 7/9/2002 2
> 7/11/2002
>
> Since we are using Oracle 8 I cannot use LEAD analytic function
> provided in 8i and 9i. There is no ID column as well.
>
> I appreciate any help. Thank you in advance.
>
> Philip Kuan

This will require a cursor created with an order by clause and a loop in a stored procedure or anonymous block.

Daniel Morgan Received on Thu Jul 11 2002 - 15:58:36 CDT

Original text of this message

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