how to select top 700

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

how to select top 700

Post by mit »

I need to select 700th and 1400th users that voted up to now in mysql.
the db is dynamic and people still voting , so every week top 700th and top 1400 (2 persons)must be selected and win...
then can any one tell me how i can select 700th and 1400th people ?!i cant say where id='700' coz db is dynamic ...
thx
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: how to select top 700

Post by onion2k »

There are lots of different ways of doing this, but the easiest is...

Code: Select all

SELECT user_id FROM TABLE WHERE 1 ORDER BY user_id ASC LIMIT 700,1
Post Reply