Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Tricky SQL question
Vagelis Rados <Vrados_at_Singular.gr> wrote in article
<36907d77.5170628_at_news-ath.forthnet.gr>...
> change the sql statement to:
> select distinct (keyword), count(keyword)
> from keyword k
> where rownum < 11
> group by keyword
> order by 2 desc;
> The Usage of the pseudo column ROWNUM eliminates the output
> of the wuery to 10 rows.
Thanks, nice try but it won't work. :-)
ROWNUM is set before the rows are sorted by the ORDER BY clause. - It's the order the rows are retrieved - so ROWNUM's 1 to 10 will have no relation to my 'top 10'.
Thanks anyway!
-Richard B.
PS I tried this one a couple of days ago: :-(
Received on Mon Jan 04 1999 - 15:41:16 CST
![]() |
![]() |