Datacom

 View Only
Expand all | Collapse all

Does the LIMIT option implemented in the SELECT SQL statement? in order to limit the number of rows returned by the select.

  • 1.  Does the LIMIT option implemented in the SELECT SQL statement? in order to limit the number of rows returned by the select.

    Posted Sep 28, 2018 12:18 PM

    Does the LIMIT option implemented in the SQL SELECT statement?

    In order to limit the number of rows returned by the select.

     

    In standard SQL, we have the possibility to use :

                   SELECT * FROM table LIMIT 10;

                  or

                  SELET TOP 10 * FROM table;



  • 2.  Re: Does the LIMIT option implemented in the SELECT SQL statement? in order to limit the number of rows returned by the select.
    Best Answer

    Posted Sep 28, 2018 12:52 PM

    There are many different implementations of this syntax across the various DBMS. In CA Datacom the syntax is FETCH FIRST n ROWS ONLY (same as DB2). So using your example...

     

    SELECT * FROM table FETCH FIRST n ROWS ONLY;