RE: [PHP] getting only the largest or smallest values in a select statement
| From: | richard | Date: | Fri, 06 Oct 2000 23:47:38 +0000 |
| Subject: | RE: [PHP] getting only the largest or smallest values in a select statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19003@lists.php.net to get a copy of this message | ||
yep, the limit function work on all fields within any table, as does sort.
Its also good for pulling set amounts of row data for filling pages, ie,
"LIMIT 30" will give you the first valid 30 rows, or in my case about a page
worth !
richard
-----Original Message-----
From: Dave Gardner [mailto:dgardner@exactax.com]
Sent: Friday, October 06, 2000 4:26 PM
To: php-general@lists.php.net
Subject: RE: [PHP] getting only the largest or smallest values in a
select statement
At 04:26 PM 10/6/00 -0700, richard wrote:
>create the SQL statement with a sort on the field you want, and put "LIMIT
>1" on the end of the statement
>this will return you only one value, and the sort direction will determin
if
>its the largest or smallest...
Thanks, Richard. I assume this will work on time, date, timestamp and
datetime columns as well?
--
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