Re: Max int value of char field? How to find...
| From: | James Cave | Date: | Mon, 22 Oct 2001 07:37:33 +0000 |
| Subject: | Re: Max int value of char field? How to find... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71801@lists.php.net to get a copy of this message | ||
> How can I find the highest integer value in a result set like:
> 1
> 10
> 11
> 2
> 3
> a
> ab
> abc
If the table isn't huge, you could pull back all the values and try
PHP's natsort() function. That will apply a natural sort algorithm,
ordering the numbers as you expect, but I'm unsure whether the character
values will be higher or lower than the numbers.
Regards
James