Oh, well, chalk it up to experience. RLIKE is what works the way I want. DOH!

Thanks,
--Scott Brown




At 12:34 PM 10/30/2003, you wrote:
Thanks so much Brent, this is what I was looking for.

However, what do I do when I get to 'Z'?

I looked here, and now I am really confused:

http://www.mysql.com/doc/en/Comparison_Operators.html

It seems to say that BETWEEN returns a rowcount as well?

I am guessing that these all return records...

So, what should I use, RLIKE, BETWEEN or???

Thanks,
--Scott





At 11:35 AM 10/30/2003, you wrote:
This should work for you:

SELECT * FROM sometable WHERE surname BETWEEN 'A' AND 'D' ORDER BY surname

In my quick test the first parameter is inclusive while the second is not, which is why it is D and not C.

On Thursday, October 30, 2003, at 02:22 PM, Scott Brown wrote:

I want to do a string comparison like this:


SELECT * FROM sometable WHERE surname LIKE '[A-C]%' ORDER BY surname;
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to