Subject Re: Problem in Nested aggregate functions -FireBird1.5
Author Adam
--- In firebird-support@yahoogroups.com, <suresh.dodda@...> wrote:
>
> I am using following query.
>
> I am getting the error: Nested aggregate functions are not allowed
>
> Can any one suggest how to use nested aggregate functions?
>
>
>
> SELECT MAX (COUNT (usr_id)) FROM usr_det GROUP BY usr_id;


Of course anything like the above query is going to have to perform a
reverse sort on the results of a scan of the entire table. Here is
one way:

select first 1 count(usr_id)
from usr_det
group by usr_id
order by 1 desc


Adam