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: SELECT TOP N

Re: SELECT TOP N

From: <proctorh_at_email.exide.com>
Date: 1998/08/11
Message-ID: <35d07a59.10897539@news.mindspring.com>#1/1

Oracle select range:

select column
  from table
where condition
  and rownum = n

where n in the nth row number in the result set. you can also use <. >, <=, >=.

I don't know if this is Oracle 8 compliant, though.

HAP On 22 Jul 1998 06:18:48 GMT, paulkcng_at_news.netvigator.com (Ng K C Paul) wrote:

>The identity() function only works in SYBASE. How about ORACLE and MSSQL
>
>Notus Spamus (spam_at_verio.com) wrote:
>: select seq = identity(9), *
>: into #tmp from tbl
>: order by some_columns
>: select *
>: from #tmp
>: where seq = @N
>:
>: Or expand to a range:
>: where seq between @M and @N
>:
>: Ng K C Paul wrote:
>: >
>: > How about if I want the Nth record only and I want N is a parameter
>: > passed to a stored procedure. Can I do that?
>: >
Received on Tue Aug 11 1998 - 00:00:00 CDT

Original text of this message

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