mysqlsoundex

How to query soundex() in mysql


What is the proper structure for searching within MySql using soundex()? I know how to produce a soundex():

select soundex('str');

just not sure how to include this in my query.


Solution

  • If you're searching for "lewis" against the name field of people table, you perform this query:

    SELECT *
    FROM people
    WHERE soundex("lewis") = soundex(name);
    

    example here