From: Shantanu Oak [mailto:[EMAIL PROTECTED]
Sent: 04 June 2004 17:26
To: [EMAIL PROTECTED]
Subject: average in Group By
Hi,
I am trying to find average price of the shares in the
portfolio table.
I thought something like this should work...
SELECT symbol, ((sum(buyrate*quantity))/quantity) as
ave
On Fri, Jun 04, 2004 at 09:25:58AM -0700, Shantanu Oak wrote:
> I am trying to find average price of the shares in the
> portfolio table.
> I thought something like this should work...
> SELECT symbol, ((sum(buyrate*quantity))/quantity) as
> average
> from portfolio group by symbol;
>
> It does w
Hi,
I am trying to find average price of the shares in the
portfolio table.
I thought something like this should work...
SELECT symbol, ((sum(buyrate*quantity))/quantity) as
average
from portfolio group by symbol;
It does work, but wrong results. What is the correct
query?
Shantanu Oak