Re: First two maximum and minimum value
From: michael ngong <mngong_at_yahoo.com>
Date: 22 Jul 2002 11:48:46 -0700
Message-ID: <ecf365d5.0207221048.4ea25c8f_at_posting.google.com>
Date: 22 Jul 2002 11:48:46 -0700
Message-ID: <ecf365d5.0207221048.4ea25c8f_at_posting.google.com>
If you are using 8i and above
select *
from (select * from YOUR_TABLE order by TABLE_COL desc) where rownum<3
This will give you the two highest columns
change desc to asc and you have two lowest columns
Michael Tubuo Ngong(Sr DBA)
ohelcsc_at_yahoo.com (Leader) wrote in message news:<b1a93c73.0207200516.57fe8f94_at_posting.google.com>...
> Hi All,
>
> I have a table(suppose emp table) From there i need to select First
> two persons salary who get maximum salary. and two persons salary who
> get minimum salary.
> Can anyone pls help me..
>
>
> Thanks
> hoque
Received on Mon Jul 22 2002 - 20:48:46 CEST