Hi All

Not sure if this problem is specific to DBISAM or not.

I WANT to run some SQL that goes (greatly simplified):

Select (SUM(Volume * Price) / SUM(Volume)) as AvgPrice

to give a weighted average Price but am prevented from using an aggregate 
function within an expression.

I know I can do this by reading the aggregates into a Temp table, but is there a nifty 
alternative way to achieve this? 

TIA

Mark
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/

Reply via email to