Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    South Germany
    Posts
    3

    Unanswered: How to suppress exceeding number of records

    Is there any way how to limit the number of returned records to a certain value? I have a table which holds millions of measurement data and timestamps. When I do a select for a certain time range, I may get back thousends of records and I only need to present the first 25 for a preview.
    The function COUNT(*) will not work, since I cannot calculat something like ... select where ... COUNT(*) > (COUNT(*) -25)
    Many thanks for every hint!
    Hermann

  2. #2
    Join Date
    Jan 2003
    Posts
    19
    Within Informix there is a directive that you can give that will limit the rows returned (Not sure which release this appeared in though, so you'll have to check your documentation).... the syntax is:

    SELECT FIRST n column_name FROM table_name

    eg

    SELECT FIRST 10 * FROM systables

    OR

    SELECT FIRST 3 tabid,tabname FROM systables

  3. #3
    Join Date
    Feb 2003
    Posts
    45
    MySQL - also uses the LIMIT keyword

    For Oracle - SELECT * FROM TABLE_XXX WHERE ROWNUM < 100;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •