
 | | To find second highestvalue in the column Author :: Arjun Patil Date :: Mon 08/03/2009 @ 12:14 |
| To find the second highets value of the column so the logic behind this is fist of all we have to make all the values in desc order then select the fron the desc select top2 and from top2 select min value. This will helpful if the col more enough values in it.
READ MORE ABOUT THIS POST
To find the second highets value of the column so the logic behind this is fist of all we have to make all the values in desc order then select the fron the desc select top2 and from top2 select min value. This will helpful if the col more enough values in it. select
MIN([number]) from( select top 2 * from [table] ORDER BY [number] desc) anythinginsated of putting 2 if you want 3rd min value in the table u can put top 3 * from...
|
| |
|
|
 SQL Server Tips Home SQL Server Articles Home SQL Server Scripts Home |