[AccessD] complex query!!

Pedro Janssen pedro at plex.nl
Fri Jan 14 15:37:50 CST 2005


Hello Gustav,

thanks for the supplementing.
Indeed some of the values are not unique.

- Pedro -


----- Original Message ----- 
From: "Gustav Brock" <Gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Friday, January 14, 2005 9:23 AM
Subject: Re: [AccessD] complex query!!


> Hi Pedro
> 
> Bob is right that the AVG() is not needed.
> 
> Further, by second thought, Group By on the values may cause strange
> results if they are not unique. If so you should Group By on the ID of
> the tables.
> 
> /gustav
> 
> >>> pedro at plex.nl 13-01-2005 20:51:49 >>>
> Hello Gustav and Rob,
> 
> thanks for the help.
> GROUP BY on the fields to, was something i must had noticed myself.
> 
> Greetings Pedro
> 
> 
> 
> ----- Original Message ----- 
> From: "Bob Hall" <rjhjr at cox.net>
> To: <accessd at databaseadvisors.com>
> Sent: Wednesday, January 12, 2005 10:20 PM
> Subject: Re: [AccessD] complex query!!
> 
> 
> > On Wed, Jan 12, 2005 at 09:05:41PM +0100, Gustav Brock wrote:
> > > Hi Pedro
> > > 
> > > Bob is right but you need to Group By on the fields too:
> > > 
> > >   SELECT 
> > >     Avg(tblGroup1.FieldA+tblGroup2.FieldB)/2 AS Avg2
> > >   FROM 
> > >     tblGroup1,
> > >     tblGroup2
> > >   GROUP BY 
> > >     tblGroup1.FieldA,
> > >     tblGroup2.FieldB;
> > 
> > If that's what Pedro wants, then he doesn't need Avg(). 
> > SELECT (tblGroup1.FieldA+tblGroup2.FieldB)/2 AS Avg2
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> 





More information about the AccessD mailing list