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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Displaying Oracle resultset in pages

Re: Displaying Oracle resultset in pages

From: Jan Korecki <Jan.Korecki_at_contactor.se>
Date: Mon, 17 Nov 2003 15:32:13 +0100
Message-ID: <3fb8dc1e$0$97842$57c3e1d3@news3.bahnhof.se>


Hello!

Check out asktom:

http://asktom.oracle.com/pls/ask/f?p=4950:8:1280765191206413595::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:127412348064,

example:

SELECT *
   FROM ( SELECT a.*, ROWNUM rnum

          FROM ( SELECT * FROM hr.employees ORDER BY employee_id DESC ) a
           WHERE ROWNUM <= &MAX_ROWS )

  WHERE rnum >= &MIN_ROWS

to get the first 25 records: MIN_ROWS=1 , MAX_ROWS=25 the next 25: MIN_ROWS=26, MAX_ROWS=50
...

The query performance will degrade when min_rows get high but that is usually not a problem because people usually dont check the records on "page 10" in google.

Regards,
Janne!

Erik wrote:

> Hi,
>
> I'd like to perform a search on an Oracle database and then display
> the resulting records over different pages, much like the way
> Google-searchresults appear. Can anybody tell me how the SQL would
> look like?
>
> Thanks,
> Erik
Received on Mon Nov 17 2003 - 08:32:13 CST

Original text of this message

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