Re: GROUP BY question

From: Heinz Huber <hhuber_at_racon-linz.at>
Date: Fri, 20 Apr 2001 08:49:58 +0200
Message-ID: <3ADFDC16.93857E1C_at_racon-linz.at>


Hi,

Dan Star wrote:
>
> Carlos,
>
> I had to remove CustPN from the SELECT clause in the sub query and then
> it worked in Access97.
>
> Thanks,
> Dan
>
> Carlos Bromanski wrote:
> >
> > SELECT Whse, CustPN, Price
> > FROM ThatTable AS A
> > WHERE Price = (
> > SELECT max(Price), CustPN
> > FROM ThatTable AS B
> > WHERE B.CustPN = A.CustPN
> > GROUP BY CustPN)

Keep in mind though, that this query might give you more than one row per CustPN if there is more than one row with the maximum Price.

Regards,
Heinz Received on Fri Apr 20 2001 - 08:49:58 CEST

Original text of this message