List:General Discussion« Previous MessageNext Message »
From:Hank Marquardt Date:July 15 2001 1:38am
Subject:Re: Newbie Questions
View as plain text  
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.
> 
> rear@stripped   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 <mysql-thread79595@stripped>
> To unsubscribe, e-mail <mysql-unsubscribe-hmarq=yerpso.net@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-- 
Hank Marquardt <hank@stripped>
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

Thread
Newbie QuestionsBob Rea15 Jul
  • Re: Newbie QuestionsHank Marquardt15 Jul
    • Re: Newbie QuestionsGrigory Bakunov15 Jul
  • Re: Newbie QuestionsPaul DuBois15 Jul