Re: rownum

From: Hans Forbrich <forbrich_at_telusplanet.net>
Date: Fri, 27 Apr 2001 05:56:17 GMT
Message-ID: <3AE90ACA.3A1E20E2_at_telusplanet.net>


Have you checked out the new analytic functions in 8i - such as RANK? I'm sure one of these (as well as LEAD & LAG) goes in the right direction. Best place to look - http://otn.oracle.com > documentation > General Documentation > Server & SQL*Plus > SQL Reference

/Hans

Chaz wrote:

> can anyone help me find a way to limit the number of records returned in a
> select statement? here's what i mean:
>
> in MS SQL Server, the "TOP n" kewords (as in "SELECT TOP 10 fname FROM
> table") specify how many records *out of the resultset generated from the
> rest of the select statement* are actually returned. in Oracle, the closest
> thing I've found is "WHERE rownum <= n". But this rownum is an internal
> index, so it doesn't limit the resultset to the top n of that resultset, but
> to records whose rownum is <= n. Theres a huge difference here, and I'm
> totally stumped.
>
> is there a similar keyword in Oracle?
> do i have to spend the next week writing a stored proc to achieve this?
> any clues?
>
> thx in advance.
  Received on Fri Apr 27 2001 - 07:56:17 CEST

Original text of this message