Subject RE: [firebird-support] Re: SubSelect Question
Author Alan McDonald
> I just ran this query:
>
> SELECT (select avg(volume) from ABNTRADEDATA where volume >0), (select
> avg(volume) from abntradedata where volume <0) AVG_VOLUME from
> ABNTRADEDATA;
>
> and it took me 458seconds to execute? what's wrong here?
>

Use RDB$DATABASE instead of ABNTRADEDATA as the last reference - there is
only one record in RDB$DATABASE

SELECT (select avg(volume) from ABNTRADEDATA where volume >0), (select
avg(volume) from abntradedata where volume <0) AVG_VOLUME from
RDB$DATABASE;

Alan