2 Replies Latest reply: May 7, 2013 4:39 AM by Irian RSS

    SQL Developer - how to limit rows in output

    1007398
      I want to look at a record (Select * ), but only want to view the first 10 rows, for field info. How do I limit the row output to 10 rows?
        • 1. Re: SQL Developer - how to limit rows in output
          rp0428
          Welcome to the forum!
          >
          I want to look at a record (Select * ), but only want to view the first 10 rows, for field info. How do I limit the row output to 10 rows?
          >
          What does that have to do with SQL Developer?

          You can limit the rows a query returns by using ROWNUM
          SELECT * FROM myTable where rownum < 11
          If you just need column info you can describe the table
          SQL> set serveroutput on
          SQL> desc dept
           Name                                      Null?    Type
           ----------------------------------------- -------- ----------------------------
          
           DEPTNO                                    NOT NULL NUMBER(2)
           DNAME                                              VARCHAR2(14)
           LOC                                                VARCHAR2(13)
          
          SQL>
          If you have SQL questions you need to post them in the SQL and PL/SQL forum
          PL/SQL
          • 2. Re: SQL Developer - how to limit rows in output
            Irian
            If you are just looking for a way to quickly see only a small subset of a larger query, in SqlDeveloper you can configure
            Tools -> Preferences -> Database -> Advanced -> Sql Array Fetch Size
            This will limit the first rows shown by any query, but the remaining results will be shown if you scroll the result set; there is a default value set to 50 records and a maximum of 500.