Re: Complex SQL

From: emerald <emerald_at_net.hr>
Date: Sat, 26 Oct 2002 14:34:29 +0200
Message-ID: <ape24a$651$1_at_sunce.iskon.hr>


select date, avg(numeric_value) over (order by date) from my_table

You can check chapter 17 of Data warehousing guide for additional help on this.
This kind of query can't be used in pl/sql directly. If you need to use it anyway, use it with execute immediately.

Also, iz seams that Oracel OLEDB provider 9.2 doesn't support this kind of query (it suported it in 8.1.6 - 9.0.1). It seams to me it's a bug in 92.

Jim <jschneider_at_kjinteractive.com> wrote in message news:8e6a91e3.0210250837.57983b3b_at_posting.google.com...
> Maybe not so complex, but I don't know how to do it.
>
> My table is setup like this:
>
> Date Numeric Value
> -------------- --------------
> 01/02/2002 10
> 01/03/2002 17
> 01/04/2002 83
> ....
>
> What I'd like to do is to get the average (AVG) of
> the "Numeric Value" column at each date interval, with a
> single SQL statement. That is, an SQL statement that
> returns:
>
> 01/02/2002 10
> 01/03/2002 13.5 [(10 + 17)/2]
> 01/04/2002 55 [(10 + 17 + 83)/3]
>
> Thanks in advance for any help.
Received on Sat Oct 26 2002 - 14:34:29 CEST

Original text of this message