Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP: SELECT TOP 10

Re: HELP: SELECT TOP 10

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Sat, 17 Apr 1999 17:38:36 +0200
Message-ID: <924363650.28325.0.rover.d4ee154e@news.demon.nl>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US