regular expression or replace function in where clause of a mysql query.

Posted by Salil on Stack Overflow See other posts from Stack Overflow or by Salil
Published on 2010-04-07T08:34:46Z Indexed on 2010/04/07 8:43 UTC
Read the original article Hit count: 404

Filed under:
|
|

Hi All,

I write a mysql query

select * from table where name like '%salil%'

which works fine but it will no return records with name 'sal-il', 'sa@lil'.

So i want a query something like below

select * from table where remove_special_character_from(name) like '%salil%'

remove_special_character_from(name) is a mysql method or a regular expression which remove all the special characters from name before like executed.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query