RE: [PHP] getting only the largest or smallest values in a select statement
| From: | Dave Gardner | Date: | Fri, 06 Oct 2000 23:25:37 +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-19002@lists.php.net to get a copy of this message | ||
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?