RE: REGEXP vs LIKE/OR

2008-08-15 Thread emierzwa
mdahl [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2008 5:12 AM To: mysql Subject: REGEXP vs LIKE/OR Hi, I want to retrieve all records where the field "value" contains either "foo", "bar" or "baz". Like so: SELECT id FROM table WHERE value LIKE &#x

REGEXP vs LIKE/OR

2008-08-15 Thread Morten Primdahl
Hi, I want to retrieve all records where the field "value" contains either "foo", "bar" or "baz". Like so: SELECT id FROM table WHERE value LIKE '%foo%' OR value LIKE '%bar%' OR value LIKE '%baz%'; But then I stumbled upon REGEXP, and can do the same this way: SELECT id FROM table WHERE

Re: REGEXP vs LIKE

2002-03-03 Thread Jeremy Zawodny
On Mon, Mar 04, 2002 at 02:42:46PM -0800, destr0 wrote: > filter fodder: mysql, database, sql > > whigh one is faster? > > REGEXP or LIKE? LIKE is generally faster. But LIKE can't do everything that REGEXP can, so that's probably no surprise. Jeremy -- Jeremy D. Zawodny, <[EMAIL PROTECTED]>

Re: REGEXP vs LIKE

2002-03-03 Thread Arjen Lentz
Hi, On Tue, 2002-03-05 at 08:42, destr0 wrote: > whigh one is faster? > REGEXP or LIKE? LIKE is an SQL language construct, REGEXP is a function. LIKE only uses two simple wildcards (_ and *). Provided your LIKE pattern does not start with a wildcard, the server will be able to use an index for i

REGEXP vs LIKE

2002-03-03 Thread destr0
filter fodder: mysql, database, sql whigh one is faster? REGEXP or LIKE? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request thi