Subject RE: [firebird-support] Re: SubSelect Question
Author Alan McDonald
> A stored procedure.
>
> create procedure GetAverages
> returns (
> AvPriceForPos numeric(18,2),
> AvVolPos numeric (18,2),
> AvVolNeg numeric (18,2)
> )
> as
> begin
> select
> avg(volume), avg(price) from abntradedata
> where volume > 0
> into :AvVolPos, :AvPriceForPos;
> select avg(volume) from abntradedata
> where volume < 0
> into :AvVolNeg
> end
>
> That's two queries but no subqueries to slow you down.
>

I wouldn't mind seeing a test result of this - I doubt that a subquery would
be any slower at all over this SP method

Alan