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: Selects only the first 200 records aftering ordering from a table.

Re: Selects only the first 200 records aftering ordering from a table.

From: Paweł Plichta <Pawel_Plichta_at_netia.pl>
Date: Fri, 17 Apr 1998 09:11:23 +0200
Message-ID: <6h6vaj$ntn$1@info.nask.pl>


Sorry, I had a good idea, but...
Below right way
First way:

    SELECT A, B, C
    FROM table
    WHERE rowid in (select rowid
     from table
    where Condition
     AND rownum < 500)
    ORDER BY C, B;
Second way:
  Step 1:
    CREATE VIEW q_table
    AS
    SELECT *
    FROM table
    WHERE Condition
     AND rownum < 500 ;
 Step 2.

    select A,B,C
    from q_table
    order by C,B;

Second way is faster than first, but "Condition" must be CONST. Received on Fri Apr 17 1998 - 02:11:23 CDT

Original text of this message

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