Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP: SELECT TOP 10
Hi Harald,
You could try to use inline views (and a simply don't know whether this will
work I didn't try it yet): like this
select a.*
from (select name from person order by name desc) a
where rownum < 11
2
If you copied this from your statement, the + sign should directly follow
the comment sign, like this /*+, and there should be a space only between
the table name and the index name.
Also note, if you use a table alias, you must use the table alias instead of
the tablename in your hints, or it will not work.
Hth,
Sybrand Bakker, Oracle DBA
Harald Mika wrote in message <3717F768.C0DEFBDF_at_Mika.de>...
>Two very urgent questions:
>
>1. Is there a way to perform a query like
>SELECT TOP 10 NAME ..... FROM PERSONS ORDER BY NAME
>which will generate only the first 10 records. There is something like
>this in MS Access. I'm sorry to mention this!
>
>2. How do I manipulate the execution plan of query. I want to force
>Oracle to use a specific index. I tried the hint /* + INDEX (PERSONS,
>PERSON03) */ but Oracle does not seem to recognize this.
>
>Any help is appreciated. It would be great if it was before Sunday!!!
>
>Thanks
>Harald
>
Received on Sat Apr 17 1999 - 10:38:36 CDT