sql server中的Second Min值 [英] Second Min value in sql server
本文介绍了sql server中的Second Min值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的桌子上有10条记录............
现在我想找到Fess专栏的第二个最小值....... .....
怎么弄它
I have 10 records in my table ............
now I want to find the second minimum value from the Fess column............
how to get it
推荐答案
select min(your_field) from your_table where your_field NOT IN (select distinct TOP 1 your_field from your_table ORDER BY your_field DESC)
问候......
Regards...
简单的一个
Simple one
SELECT TOP 1 Fees FROM
(
select top 2 * from table order by Fees ASC
) AS Table ORDER BY Fees DESC
>
Select MIN(Sal) From TableName
Where Sal > (Select MIN(sal) From TableName)
这篇关于sql server中的Second Min值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文