mysql 根据发音查找内容

当前表

mysql> select * from table1;
+----------+------------+-----+
| name_new | transactor | pid |
+----------+------------+-----+
| 1hahha   | 1xiaohong  |   1 |
| 2hahha   | 2xiaohong  |   2 |
| 3hahha   | 3xiaohong  |   3 |
| 4hahha   | 4xiaohong  |   4 |
| 3hahha   | bob        |   5 |
| 3hahha   | lee        |   6 |
+----------+------------+-----+
6 rows in set (0.00 sec)

根据发音查找内容

mysql> select transactor from table1 where soundex(transactor)=soundex("lie");
+------------+
| transactor |
+------------+
| lee        |
+------------+
1 row in set (0.00 sec)

原文地址:https://www.cnblogs.com/sea-stream/p/11299364.html