最大值
select num from table order by num desc limit 0,1
第二大
select num from table order by num desc limit 1,1
第三大
select num from table order by num desc limit 3,1
最小值
select num from table order by num limit 0,1
追问你好,我是想比如通过判断table表里面某几个字段值(f1,f2,f3,f4)如果是第二大,赋一类值,第三大赋另一类值改怎么写if语句?谢谢