Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL quesion: top 10 for each day
HI!!
Possible!!
sample SQL
1)
select point, ename
from emp e1
where 10 <(select count(*)
from emp e2 where e2.point >e1.point)order by point desc;
2)
select rownum AS rank, -point point, ename
from (select -point point, ename from emp e1 where 10 >(select count(*) from emp e2 where e2.point>e1.point) group by -point,ename) ;
GOOD LUCK!!
"NetComrade" <andreyNSPAM_at_bookexchange.net> wrote in message
news:3a11d4e3.1153838772_at_news.earthlink.net...
> let's say I have a table with some kind of points and date
> I would like to get top 10 points for each day.
> possible?
>
> thanx.
> ---------------
> In case I forgot to mention:
> We use Oracle 7.3.4 and 8.1.6 on Solaris 2.6, 2.7 boxes
> ---------------
> Andrey Dmitriev eFax: (978) 383-5892 Daytime: (917) 750-3630
> AOL: NetComrade ICQ: 11340726 remove NSPAM to email
Received on Wed Nov 15 2000 - 01:46:15 CST