How to get second largest or third largest entry from a table

前端 未结 12 2509
说谎
说谎 2020-12-01 08:42

Can anyone please tell me how to find out the N th largest entry from a table in Oracle?

Like for largest we can use MAX(column_name) i

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-01 09:27

    You can try this sql where Row_number() function of the oracle sql is used

    select column_name from (
     select column_name ,  
    row_number() over (order by column_name  desc) as  row_num  
    from table_Name ) tablex
    where row_num =3
    

提交回复
热议问题