Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky question for simple SQL
"Kristian Myllymäki" <kristian_at_kmja.com> wrote in message news:<3XMoc.12679$EV2.108122_at_amstwist00>...
> How about,
>
> where min_object_value = object_value
> group by year, month, adjust_demand_id, object_value
>
Hi,
here the same approach, but IMHO more stringent
select * from (
select YEAR,MONTH,ADJUST_DEMAND_ID,OBJECT_VALUE,PRT_ID,
ROW_NUMBER() over (partition by YEAR,MONTH,ADJUST_DEMAND_ID order by
OBJECT_VALUE) rn
from [your table])
where rn=1
Greetings
Martin
Received on Wed May 19 2004 - 12:48:21 CDT
![]() |
![]() |