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: Simple SQL Question

Re: Simple SQL Question

From: Kevin Bass <akil1_at_mindspring.com>
Date: Sat, 11 Apr 1998 08:30:48 -0400
Message-ID: <6gnnsa$v5c$1@camel29.mindspring.com>


Paulo Odulio:

Just add and rownum <= 3 at the end of your WHERE clause. This will give you the first three records being selected. An example is below:

select ename, sal
from emp
where <condition>

    and rownum <= 3
order by sal desc;

Kevin

Paulo Odulio wrote in message <352EDF4B.5782278C_at_email.sps.mot.com>...
>
>
>What shall I add to the where clause to be able to
>get only the first 3 records?
>
>select ename, sal
>from emp
>where <condition>
>order by sal desc;
>
>Thanks,
>-Paulo
>
Received on Sat Apr 11 1998 - 07:30:48 CDT

Original text of this message

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