You probably want to look into using RLIKE or REGEXP.

SELECT id,name FROM tabename WHERE name RLIKE '^[abc]'

----- Original Message ----- From: "Ravi Kumar." <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Thursday, September 14, 2006 7:37 AM
Subject: Like inside in clause


Dear Friends,

Is there a way to specify wildcard inside values of an in clause. I want to
be able to do this:

   select id, name from tableName where name in ('a%', 'b%', 'c%');

instead of doing
   select id, name from tableName where name like 'a%' or name like 'b%' or
name like 'c%';

Thanks,
Ravi.


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

Reply via email to