Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Q: select query - I want one row to be unique
here's one way...
select product, price
from T a
where mydate = (select max(mydate) from T b where a.product = b.product)
jacob_nordgren_at_hotmail.com (Jacob Nordgren) wrote in message news:<47c6b9be.0108070125.21f353e0_at_posting.google.com>...
> Hi,
>
> I have this data
>
> PRODUCT PRICE MYDATE
> 1 12 2001-08-01
> 1 13 2001-08-07
> 2 14 2001-08-03
>
> I want to get a list of all the products with the latest price only
> (no duplicate products). I know how to do the query without the price
> part:
>
> "SELECT PRODUCT, MAX(MYDATE) FROM T GROUP BY PRODUCT" works fine.
>
> How can I include the PRICE column into the result?
>
> / Jacob
Received on Tue Aug 07 2001 - 07:33:03 CDT
![]() |
![]() |