古詩詞大全網 - 成語查詢 - oracle 怎麽提取第二大的數值?

oracle 怎麽提取第二大的數值?

select b1.市,max(b1.訂單號) from 信息表 b1 inner join (select 市,max(訂單數) max_訂單數 from 信息表 group by 市) b2

on b1.市=b2.市 and b1.訂單數<b2.max_訂單數

group by b1.市