RE: [PHP-DB] Selecting Alphabetically

2002-03-22 Thread Robert V. Zwink
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

Re: [PHP-DB] Selecting Alphabetically

2002-03-21 Thread Andrey Hristov
select * from sometable where (SUBSTRING(somefield,1,1) in ('a','b','c','d','f','g','h')) AND (SUBSTRING(somefield,2,1) in ('i','j','k','l','m','n','o','p')); Best regards, Andrey Hristov - Original Message - From: Jordan Elver [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday,

RE: [PHP-DB] Selecting Alphabetically

2002-03-21 Thread Rick Emery
SELECT * FROM mytable WHERE record_name REGEXP ^[a-h] -Original Message- From: Jordan Elver [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 21, 2002 6:05 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Selecting Alphabetically Hi, Could anyone point me in the right direction with this one