Re: how can i find out the second maximum value from a table by sql

From: Ashwani Chopra <ashwani_chopra_at_mdsaero.ca>
Date: 14 Feb 2002 07:44:21 -0800
Message-ID: <ddff4476.0202140744.7d31566_at_posting.google.com>


sohelcsc_at_yahoo.com (Leader) wrote in message news:<b1a93c73.0202132336.4191d0e6_at_posting.google.com>...
> 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 Thu Feb 14 2002 - 16:44:21 CET

Original text of this message