how to get rowid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • udhayageetha
    New Member
    • Feb 2008
    • 1

    how to get rowid

    hi

    can anybody help me?

    can i get row in table which i want ..
    like 1st row / 5th row...
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by udhayageetha
    hi

    can anybody help me?

    can i get row in table which i want ..
    like 1st row / 5th row...
    The standard MySQL documentation on the LIMIT option of the SELECT command supplies the answer to that:
    Originally posted by MySQL documentation
    The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be non-negative integer constants (except when using prepared statements).

    With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1): e.g.

    SELECT * FROM tbl LIMIT 5,10; # Retrieve rows 6-15
    Ronald

    Comment

    • code green
      Recognized Expert Top Contributor
      • Mar 2007
      • 1726

      #3
      SELECT * FROM tbl LIMIT 5,10; # Retrieve rows 6-15
      Rows being rows of the resultset, not the table.
      You need to be careful because without an ORDER BY you can't guarantee
      the same 10 records will be returned every time..

      Comment

      Working...