Re: Limiting results to X number of rows
| From: | Vortex | Date: | Sun, 02 Jul 2000 17:54:32 +0000 |
| Subject: | Re: Limiting results to X number of rows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4381@lists.php.net to get a copy of this message | ||
Add a LIMIT X clause to the end of the query, where X is the number of rows
you want it to return.
----- Original Message -----
From: "CDitty" <mail@redhotsweeps.com>
To: <php-general@lists.php.net>
Sent: Sunday, July 02, 2000 10:45 AM
Subject: [PHP] Limiting results to X number of rows
> Does anyone know of a way to limit the mysql return results to X number of
> rows? In Oracle, I use rowcount < 10, but I can't use this in Mysql.
>
> The only way I can think to do this is to do a select then subtract the
> number I want from the total. Then in the select statement I need it in,
> select * from table where id > previous_select.
>
> Any tips?
>
> CDitty
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>