Subject | Re: Subselect error |
---|---|
Author | Svein Erling Tysvær |
Post date | 2005-09-06T13:25:47Z |
Just another question whilst waiting for Arno: Is it intentional that
your subselect
(SELECT SUM(NVV.NF_BaseICMSX) FROM NotasVenda_Valores NVV2
WHERE NVV2.Fil_Codigo = NVV.Fil_Codigo AND
NVV2.Ser_Codigo = NVV.Ser_Codigo AND
NVV2.NF_Numero = NVV.NF_Numero AND NVV2.NF_AliqICMSX =
17 ) AS Base17,
SUMs a field in NVV and not in NVV2? A subselect from a table in the
main select rather than the one in the subselect confuses my head
enough to understand that Firebird has problems giving an answer...
Maybe fixing this would be enough for the 'GROUP BY ..., 4' to work?
Set
your subselect
(SELECT SUM(NVV.NF_BaseICMSX) FROM NotasVenda_Valores NVV2
WHERE NVV2.Fil_Codigo = NVV.Fil_Codigo AND
NVV2.Ser_Codigo = NVV.Ser_Codigo AND
NVV2.NF_Numero = NVV.NF_Numero AND NVV2.NF_AliqICMSX =
17 ) AS Base17,
SUMs a field in NVV and not in NVV2? A subselect from a table in the
main select rather than the one in the subselect confuses my head
enough to understand that Firebird has problems giving an answer...
Maybe fixing this would be enough for the 'GROUP BY ..., 4' to work?
Set
--- In firebird-support@yahoogroups.com, "Ricardo Malikoski" wrote:
> Oks..
>
> Thanks...
>
> Helppppp.. hehehehe
> ----- Original Message -----
> From: Martijn Tonies
> To: firebird-support@yahoogroups.com
> Sent: Monday, September 05, 2005 3:09 PM
> Subject: Re: [firebird-support] Subselect error
>
>
> Well, it's time to wait for Arno to reply then :-)
>
> With regards,
>
> Martijn Tonies
> Database Workbench - tool for InterBase, Firebird, MySQL, Oracle &
MS SQL
> Server
> Upscene Productions
> http://www.upscene.com
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
>
> > Firebird version is 1.52.
> >
> >
> > Can you do a GROUP BY ..., Base17
> > R : Don´t work too...
> > ----- Original Message -----
> > From: Martijn Tonies
> > To: firebird-support@yahoogroups.com
> > Sent: Monday, September 05, 2005 11:49 AM
> > Subject: Re: [firebird-support] Subselect error
> >
> >
> >
> >
> > > It´s result in other error : "Cannot use an aggregate
function in a
> GROUP
> > BY clause"
> >
> > Hmm... what version of Firebird?
> >
> > Can you do a GROUP BY ..., Base17