select 2nd row in Plsql

后端 未结 2 1444
天涯浪人
天涯浪人 2021-01-25 23:07

Lets say I have the following table:

 SomeTable(
    id, 
    price
 )

How do I select the 2nd highest priced row from this table? Note : This

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-25 23:52

    Isn't this simple? God knows why I didn't think about it before!

    select max(price) from tnum where price <> (select max(price) from tnum)

提交回复
热议问题