mysql find content based on pronunciation

 

Current table

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)

According to pronounce Find content

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

 

 

 

Guess you like

Origin www.cnblogs.com/sea-stream/p/11299364.html