SQL Query to find Nth highest salary in Oracle using ROW_NUMBER function?

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 พ.ย. 2024

ความคิดเห็น • 4

  • @chetanbhandari3033
    @chetanbhandari3033 3 ปีที่แล้ว

    Thnx for video pls create microservices series

  • @Pgswapgjjhgghh8283
    @Pgswapgjjhgghh8283 ปีที่แล้ว +2

    If there is duplicate salary then It will not work it is better to use dense_rank

    • @electricalsir
      @electricalsir 10 หลายเดือนก่อน +1

      yes you right

  • @anilgadekar3036
    @anilgadekar3036 3 ปีที่แล้ว

    Hi sir, when I use this ROW_NUMBER() function in mysql it work for me to display all records,
    >select s. *, ROW_NUMBER () OVER(order by fees DESC) as rownum from student s;
    But problem here is if we want to find second largest fees from table using Bellow query then I will get error,
    > select * from (select *.s, ROW_NUMBER() OVER(ORDER BY fees desc) as rownumber from student s) where rownumber=2;
    Can you please clear my doubts sir?