> Is there a simple way in MySQL to only select the first x rows that meet
> a specified criteria.

> For example in Oracle the following would work:

> Select * from Blah where stuff="true" and rownum <= 10
? (where rownum is not a specific column, just a count of how many rows
> have been returned)

> But MySQL doesn't like this.

> Anyone know the correct way to approach this??

The keyword you want is LIMIT - see http://www.mysql.com/doc/en/SELECT.html

LIMIT 5  - return first five rows
LIMIT 5, 10 - return sixth through fifteenth rows (row numbers count from
o)

      Alec



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to