MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Rodney Broom Date:November 26 2002 7:43pm
Subject:Re: LIMIT in MySQL
View as plain text  
From: Jim Esten <jesten@stripped>


> LIMIT is "LIMIT <starting record>,<number of records>"    ...no?

From the 4.0.0-alpha docs, section 6.4.1:

  The LIMIT clause can be used to constrain the number of rows returned
  by the SELECT statement. LIMIT takes one or two numeric arguments. If
  two arguments are given, the first specifies the offset of the first
  row to return, the second specifies the maximum number of rows to
  return. The offset of the initial row is 0 (not 1):

  mysql> select * from table LIMIT 5,10;  # Retrieve rows 6-15

  If one argument is given, it indicates the maximum number of rows to
  return: 

  mysql> select * from table LIMIT 5;     # Retrieve first 5 rows

  In other words, LIMIT n is equivalent to LIMIT 0,n. 

---
Rodney Broom
President, R.Broom Consulting
http://www.rbroom.com/

sql


Thread
LIMIT in MySQLMike At Spy26 Nov
  • RE: LIMIT in MySQLDavid Shanes26 Nov
  • Re: LIMIT in MySQLPaul DuBois26 Nov
  • RE: LIMIT in MySQLJim Esten26 Nov
    • Re: LIMIT in MySQLRodney Broom26 Nov
  • Re: LIMIT in MySQLBenjamin Pflugmann26 Nov
  • RE: LIMIT in MySQLJennifer Goodie26 Nov
  • Re: LIMIT in MySQLMatthew Baranowski26 Nov
  • Re: LIMIT in MySQLRay26 Nov
  • Re: LIMIT in MySQLSteve Edberg26 Nov