Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: GROUP BY question

Re: GROUP BY question

From: André Gamache <andre.gamache_at_sympatico.ca>
Date: Fri, 20 Apr 2001 21:19:25 GMT
Message-ID: <3AE0A8F9.25C6CA40@sympatico.ca>

Hi:
try this

select Whse, CustPN, maxP
from (select CustPN, max(price) as maxP From T Group by CustPN )
Order by Whse

Andre

Dan Star wrote:

> Given a table like:
>
> Whse CustPN Price Notes
> 208 34512 6.50 called to expedite on 4/2
> 209 34512 7.50
> 210 34512 7.00
> 208 55555 2.00
> 209 55555 1.50 last receiving on 4/6 was damaged
>
> is there a way to use SQL to GROUP BY CustPN MAX(Price) and return
>
> 208 55555 2.00
> 209 34512 7.50
>
> Dan
Received on Fri Apr 20 2001 - 16:19:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US