Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: my problem with
On Mon, 30 Aug 2004 15:57:33 +0200, "dead"
<OVOIZBACI-vlasic_at_vodatel.net> wrote:
>You didn't understend what I need. User of my application have to see
>records in order by Field1 but only records with first 50 values of that
>field, that's meen records with value from '000001' to '000050'
>You can try to insert records in nonsequenced order and you will see that.
>
>Does you now is any oracle command that I say database to use index in some
>query?
Actually your statement is simply incorrect, or you are telling fairy
tales.
Why would the 'first' 50 records have f1 ranging from '00001'to
'00050'
If you are using rownum, you'll get the first 50 records of the
resultset. In the first query you perform a full table scan limited
by rownum. There is *NO*, I repeat, *NO GUARANTEE* at all, the records
which are *logically* first, are also *physically* first. That's why I
said: your approach is going to fail sooner or later.
The truth is you didn't understand my answer and your statement is
simply incorrect. If you need records numbered from '00001' to
'000050', you need to have an appropiate where clause. ROWNUM is not a
replacement for using an appropiate where clause.
As to your question: please look up using HINTS in the Oracle
documentation,
and do something about your English: it is so bad, it is almost
incomprehensible. 'Does you now is' does not constitute a correct
grammatical unit in any fashion.
-- Sybrand Bakker, Senior Oracle DBAReceived on Mon Aug 30 2004 - 09:28:19 CDT