Subject Re: [firebird-support] Problem when group by a sub-query
Author Claudio Romero
Thanks !!!!

Works fine and fast

Regards



2013/7/19 Tomasz Tyrakowski <t.tyrakowski@...>

> **
>
>
> On 2013-07-19 16:18, Claudio Romero wrote:
> > Problem when group by a sub-query
> > I have
> > select (select cobrador from BUSCA_COBRADOR_POR_aplicante
> (a.clave_fact)),a.ftot
> > from VISTA_COMPROBANTES a
> >
> > (BUSCA_COBRADOR_POR_aplicante is a Stored Procedure)
> >
> > I must sum(ftot) group by cobrador [...]
>
> I'd suggest a simple cheat:
>
> select cobrador, sum(ftot) from (
>
> select
> (select cobrador from BUSCA_COBRADOR_POR_aplicante
> (a.clave_fact)) as cobrador,
> a.ftot as ftot
> from VISTA_COMPROBANTES a
> )
> group by cobrador;
>
> regards
> Tomasz
>
> --
> __--==============================--__
> __--== Tomasz Tyrakowski ==--__
> __--== SOL-SYSTEM ==--__
> __--== http://www.sol-system.pl ==--__
> __--==============================--__
>
>
>


[Non-text portions of this message have been removed]