Try RLIKE or REGEXP -- 

http://www.mysql.com/docs/S/t/String_comparison_functions.html



On Sat, Jul 14, 2001 at 06:39:00PM -0700, Bob Rea wrote:
> OK, mr newbie here. I'm trying to lern SQL using MySQL. I have a 
> general SQL book, Sams Teach Yourself  SQL in 10 Minutes, by Ben 
> Forta. I also have mSQL and MySQL fromO'Reilly. And of course i have 
> the MySQL Manual.
> 
> The 10 minute book's syntax sometimes doesn't fit MySQL's, so I try 
> to find the MySQL way by trial and error, or ny the O'Reilly book. 
> Some times this works and sometines I fail. For instance, the 10 min 
> book has a query:
> 
> SELECT cust_contact
> FROM Customers
> WHERE cust_contact LIKE '[JM]%'
> ORDER BY cust_contact;
> 
> The reply is:
> Empty set (0.02 sec) 
> 
> So I need to know the correct syntax for this query, such that it 
> returns only cust_contacts which begin with J or M.
> 
> I have searched the Manual and so on.
> 
> Point me in the right direction or something.
> 
> -- 
> Bob Rea
> 
>       Fear of Hell is pernicious;
>                 So is fear of Heaven.
> 
> [EMAIL PROTECTED]   http://www.sirius.com/~rear
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-- 
Hank Marquardt <[EMAIL PROTECTED]>
http://web.yerpso.net

Web & Database Development in PHP, MySQL/PostgreSQL
Small Office Networking Solutions - Debian GNU/Linux & FreeBSD
PHP Instructor - HTML Writers Guild <http://www.hwg.org>
*** PHP II "The Cool Stuff" starts July 16, 2001
*** http://www.hwg.org/services/classes/p181.1.html


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to