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

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

From: Colin Woods <newsgroupcw_at_hotmail.com>
Date: Thu, 16 Apr 1998 13:39:59 +0100
Message-ID: <3535FC1F.1FE9@hotmail.com>


Folks,

Can anyone help me ?

I have a large table, where I only want to select up to a maximum of 500 records.

I can't use ROWNUM because I want to perform an ORDER BY on the table before taking out the first 500 records.

The statement I has was

SELECT A, B, C
FROM table
WHERE Condition
AND rownum < 500
ORDER BY C, B What this select does is select 500 records, and then orders them.

What I want is to order all records first, and then return the first 500(after ordering).

Anyoue any ideas ?

P.S. I don't want to use PL/SQL and a CURSOR select if possible !.

THANKS Colin Woods. Received on Thu Apr 16 1998 - 07:39:59 CDT

Original text of this message

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