Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2006
    Posts
    57

    Unanswered: getting every 300th row

    Hello,
    I am interrested in getting every 300th row of my table. Is this possible to do in mysql? I'd prefer not to use the primary key to do this.

    for example i need row 300, 600, 900, 1200..etc

  2. #2
    Join Date
    Aug 2007
    Posts
    8
    I can only think of using % operator to achieve this.

    I'd be very interested to know if there are other ways.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    every 300th row based on what? imageuploadtimestamp? productweight? skillrating?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jul 2011
    Location
    India
    Posts
    13

    re:getting every 300th row

    Hi,

    it is not possible in single select statement.
    u need to use some logic for it like loop or cursor.

Posting Permissions

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