mysql 查询 最大值,最小值,第二大,第三大 一共四个值

最大值:select max(num) from table


第二大值:select max(num) from table
where num not in(select max(num) from table)


第三大值:select max(num) from table
where num not in(select max(num) from table
where num not in(select max(num) from table))


最小值:select min(num) from table

posted @ 2019-03-19 15:03  每每00  Views(11453)  Comments(0Edit  收藏  举报