Subject | Re: [firebird-support] Problem when group by a sub-query |
---|---|
Author | Claudio Romero |
Post date | 2013-07-19T14:26:24Z |
select (select cobrador from BUSCA_COBRADOR_POR_aplicante
(a.clave_fact))as cobrador,sum(a.ftot)
from VISTA_COMPROBANTES a
group by 1
Show this error.
Invalid expression in the select list (not contained in either an aggregate
function or the GROUP BY clause)
I use Firebird 2.1.6.
2013/7/19 Marcin Bury <marcin.bury@...>
(a.clave_fact))as cobrador,sum(a.ftot)
from VISTA_COMPROBANTES a
group by 1
Show this error.
Invalid expression in the select list (not contained in either an aggregate
function or the GROUP BY clause)
I use Firebird 2.1.6.
2013/7/19 Marcin Bury <marcin.bury@...>
> **[Non-text portions of this message have been removed]
>
>
> Claudio
>
> W dniu 19.07.2013 16:18, Claudio Romero pisze:
>
> > 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)
> >
> > Result
> > Cobrador Ftot
> > ------- ----
> > 1 369.00
> > 3 122.00
> > 1 72.00
> > 11 310.00
> > 1 85.00
> > 3 560.00
> >
> > I must sum(ftot) group by cobrador, like this
> >
> > Cobrador Sum
> > -------- ---
> > 1 526.00
> > 3 682.00
> > 11 310.00
> >
> > But in Firebird 2.1.6.18518, this sql show an error
> > select (select cobrador from BUSCA_COBRADOR_POR_aplicante
> > (a.clave_fact))as cobrador,sum(a.ftot)
> > from VISTA_COMPROBANTES a
> > group by cobrador
> >
> > Invalid expression in the select list (not contained in either an
> > aggregate function or the GROUP BY clause)
> >
> > Any workarround ?
> > Regards
> >
> Try
>
>
> select (select cobrador from BUSCA_COBRADOR_POR_aplicante
> (a.clave_fact))as cobrador,sum(a.ftot)
> from VISTA_COMPROBANTES a
> group by 1
>
>
>