Jeff Whippo wrote:
> So if we take this problem one step further:
>
> I'm looking for a way to page through result sets.
> For simplicity, let's say the result set of my
> query has 100 rows. I want to display increments
> of 10 rows on a web page. With Oracle, I could
> just do something like "select * from mytable
> where rownum between 20 and 30" (excuse the syntax
> - it's been a while for oracle). But in MySQL,
> all I see is that it provides me is a way to limit
> the number of rows returned but no way to provide
> a starting point e.g. 20 like in the my example.
> In other words, "select * from mytable limit 10"
> will always give me the FIRST 10 rows. What if I
> want the NEXT 10 rows, or the next, or the next?
>
> Any ideas how to do this in MySQL?
Please see...
http://dev.mysql.com/doc/mysql/en/select.html
You can do LIMIT with an offset, like LIMIT 0,10 for the first 10 rows,
or LIMIT 20, 10 for the 3rd set of 10 rows.
Regards,
Josh
Josh Chamas
Director, Professional Services
MySQL Inc., www.mysql.com
Get More with MySQL!
http://www.mysql.com/consulting