Như tên gọi, toán tử SOUNDS LIKE của MySQL sẽ tìm kiếm các giá trị có phát âm tương tự trong bảng. Cú pháp: Expression1 SOUNDS LIKE Expression2, trong đó cả hai biểu thức được so sánh dựa trên phát âm tiếng Anh.
Ví dụ
Ví dụ sau từ bảng student_info khớp hai biểu thức dựa trên phát âm:
mysql> Select * from student_info where name sounds like 'grov'; +------+--------+---------+------------+ | id | Name | Address | Subject | +------+--------+---------+------------+ | 105 | Gaurav | Jaipur | Literature | +------+--------+---------+------------+ 1 row in set (0.00 sec) mysql> Select * from student_info where name sounds like 'rmn'; +------+-------+---------+-----------+ | id | Name | Address | Subject | +------+-------+---------+-----------+ | 125 | Raman | Shimla | Computers | +------+-------+---------+-----------+ 1 row in set (0.00 sec)
Giải thích:
'grov'khớp với'Gaurav'(phát âm tương tự)'rmn'khớp với'Raman'