RE: [PHP] Selecting between using letters
| From: | Vail, Warren | Date: | Mon, 29 Dec 2003 22:24:21 +0000 |
| Subject: | RE: [PHP] Selecting between using letters | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-db+get-32214@lists.php.net to get a copy of this message | ||
How about the following;
SELECT DISTINCT left( name, 1 ) AS idx, count( * )
FROM users
GROUP BY idx
produces a count of the names found for each letter, then you can make
decisions about your range of letters, like a max of 250 between letters, or
some such number.
Warren Vail
-----Original Message-----
From: Doug Parker [mailto:drparker@phreshdesign.com]
Sent: Monday, December 29, 2003 2:18 PM
To: php-db@lists.php.net; php-general@lists.php.net
Subject: [PHP] Selecting between using letters
How would I create a select statement in MySQL that would return a range of
records from the LastName field where the value starts with a designated
letter - for example, returning the range where the first letter of LastName
is between A and E...
Any help would be greatly appreciated.
------------------------------------------------------------
http://www.phreshdesign.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php