Subject Re: [firebird-support] Subselect error
Author Ricardo Malikoski
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


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
>
>
> Hi,
>
> > The error : "Invalid expression in the select list(not contained in
either
> an aggregate function or the
> > GROUP BY clause)"
> >
> > I think that for subselect uses the same table, but with the different
> nickname.
> >
> >
> > > SELECT NV.OpFis_Codigo, SUM(NV.NF_VlrNota) as totContabil,
> > > SUM(NVV.NF_VlrBaseICMS27) as Base27,
> > > (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,
>
> The "Base17" result column isn't in an aggregate (eg "group by").
>
> Try to extend the "group by" column like this:
>
> GROUP BY NV.OpFis_Codigo, 4



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




------------------------------------------------------------------------------
YAHOO! GROUPS LINKS

a.. Visit your group "firebird-support" on the web.

b.. To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


------------------------------------------------------------------------------



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