If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > getting every 300th row

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-07, 16:14
Luke101 Luke101 is offline
Registered User
 
Join Date: Sep 2006
Posts: 57
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
__________________
Listsergeant
Reply With Quote
  #2 (permalink)  
Old 09-04-07, 17:20
quakey quakey is offline
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old 09-04-07, 17:55
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
every 300th row based on what? imageuploadtimestamp? productweight? skillrating?
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #4 (permalink)  
Old 07-22-11, 02:46
pasthana@netlink. pasthana@netlink. is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On