Selecting the second row of a table using rownum

后端 未结 9 1492
栀梦
栀梦 2020-11-28 14:07

I have tried the below query:

select empno from (
                   select empno 
                     from emp
                    order by sal desc
               


        
9条回答
  •  半阙折子戏
    2020-11-28 14:44

    Select * From (SELECT *,
      ROW_NUMBER() OVER(ORDER BY column_name  DESC) AS mRow
    
    FROM table_name 
    
    WHERE condition) as TT
    Where TT.mRow=2;
    

提交回复
热议问题