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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Regr_slope(y,x)

Re: Regr_slope(y,x)

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 5 Nov 2000 11:43:33 -0000
Message-ID: <973424991.21480.0.nnrp-03.9e984b29@news.demon.co.uk>

If you have exactly one row per year
you could join the table to itself.
Alternatively you could use the
lag() or lead() functions to shift the
one column by two rows, then
apply the regr_slope() to the result.

--

Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Practical Oracle 8i:  Building Efficient Databases
Publishers:  Addison Wesley Longman
Book bound date now 1st Dec 2000

keith wrote in message <8ttc7v$1cb$2_at_news.eol.ca>...

>
>
> Need help with the above function.
>
> eg.
>
> X Y
>
> .................
>
> 199911 9 4
> 199912 6 8
> 200001 7 9
> 200002 2 5
> ......
>
>
> To find the slope for the X and Y in the same row is okay but how about
> if I were to use X in row 199911 and Y in row 200001 and so on. In
> general, I would like pair of X value taking two months earlier and
> current Y.
>
> Hope someone can solve this problem ASAP.
> Thanks in advance.
>
> Keith
>
Received on Sun Nov 05 2000 - 05:43:33 CST

Original text of this message

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