This is how U can find out the 'N'th maximum value from a table by sql
Date: 18 Feb 2002 21:34:15 -0800
Message-ID: <7099f945.0202182134.942e607_at_posting.google.com>
Try out this generalised query which can fetch Nth maxim value from a
table!
select min(COLUMN_1) from (select COLUMN_1 from NEEDEDTABLE_ta order
by
COLUMN_1 DESC) where rownum <= N;
where N should be substituted for the Nth maximum value you need to
fetch out from the table.
Cheers
> sohelcsc_at_yahoo.com (Leader) wrote in message news:<b1a93c73.0202132336.4191d0e6_at_posting.google.com>...
Your comments are welcome along with variations of this you may creat
Sudhakaran.K
NCST
BANGALORE/India
> > Hi all,
> > How can i find out the second maximum value from a table by sql.
> >
> >
> > thanks
> > Hoque
>
> Hi there,
>
> Try following SQL code
>
> select max(field) from table
> where field not in (select max(field) from table);
>
> You will get second highest value
>
> Ashwani
Received on Tue Feb 19 2002 - 06:34:15 CET