Anurag Sharma
Anurag Sharma

Reputation: 5039

ignore dots and commas while making like query in mysql

I have to do a fuzzy kind of match in a column in mysql I have a column which has fields like this

column_name
-----------
A.P Name1
Name2, allias
NAME1
Name2

For case insensitivity I have done this

select coulmn_name from table where column_name like 'name' COLLATE UTF8_GENERAL_CI;

I would like to provide a search box where a user can type ap and my query would produce A.P Name1 as the output from the table. How can I ignore . & , in mysql like statement

Upvotes: 1

Views: 2165

Answers (1)

Farid Movsumov
Farid Movsumov

Reputation: 12725

You can use REPLACEfunction of mysql

Check this to to understand this better.

Upvotes: 1

Related Questions