Suraj Jaiswal
SELECT * FROM EMP WHERE ROWNUM > 5. What will be the output of the query and why
By Suraj Jaiswal in SQL Language on Jan 14 2008
  • Pankaj  Kumar Choudhary
    May, 2015 21

    I did not find this type of function or keyword in Ms Sql Server. Can you explain what is this......

    • 0
  • manoj
    Mar, 2008 10

    this query won't work bcoz rownum only understand the selective records if u put less than 5 then it will work bcoz it's consecutive records but for rownum>5 it will result none

    see example:

    SQL> SELECT * FROM EMP_mdindia WHERE ROWNUM > 5
      2  ;

    no rows selected

    • 0
  • Elias Hossain
    Jan, 2008 26

    I'm describing with a little bit descriptive way:

    1. The SQL query 'select * from Emp' will fetch all the records from Emp table

    2. The SQL query 'select * from Emp where ROWNUM>5' also fetch all the records as the result in previous but except first 5 rows.

    • 0
  • Darshan Malu
    Jan, 2008 21

    The 'ROWNUM'  is a pseudo column which returns a nummber indicating the order in which the rows are fetched from Databae.

       If Orderby clause follows the ROWNUM then the rows will be recorded by the orderby clause.

     The query 'select * from Emp where ROWNUM>5' fetch all the records of emp table

    except the first 5 records 

    • 0
  • Darshan Malu
    Jan, 2008 21

    The 'ROWNUM'  is a pseudo column which returns a nummber indicating the order in which the rows are fetched from Databae.

       If Orderby clause follows the ROWNUM then the rows will be recorded by the orderby clause.

     The query 'select * from Emp where ROWNUM>5' fetch all the records of emp table

    except the first 5 records 

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS