Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Regr_slope(y,x)
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>...Received on Sun Nov 05 2000 - 05:43:33 CST
>
>
> 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
>
![]() |
![]() |