RE: [PHP-DB] Selecting Alphabetically
| From: | Robert V. Zwink | Date: | Fri, 22 Mar 2002 21:17:17 +0000 |
| Subject: | RE: [PHP-DB] Selecting Alphabetically | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-17848@lists.php.net to get a copy of this message | ||
In MySQL you can also do this:
SELECT * FROM artists
WHERE
LEFT(title, 1) >= 'A'
AND
LEFT(title, 1) <= 'H'
ORDER BY title
This will return a range of all artists whose title begins with A thru H.
Treat the letters like numbers.
Robert V. Zwink
http://www.zwink.net/daid.php
-----Original Message-----
From: Jordan Elver [mailto:jord.elver@virgin.net]
Sent: Thursday, March 21, 2002 7:05 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Selecting Alphabetically
Hi,
Could anyone point me in the right direction with this one please.
I have a table of records wit a field of artists.
I want to select all the records which begin with the letter a-h then i-p
etc
What is the best way to do this?
Cheers,
Jord
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php