如何在Mysql中使用LIKE%..%和Soundex [英] How to use LIKE %..% with Soundex in Mysql
本文介绍了如何在Mysql中使用LIKE%..%和Soundex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须在Mysql中使用带有LIKE%...%的soundex()函数。我不知道如何编写查询。我已经进行了这样的查询。
I have to use the soundex() function with LIKE %...% in Mysql. I don't have the idea how should I write the query. I have made the query like this.
$query = "SELECT * FROM tbl_name WHERE soundex(fieldname) LIKE soundex(%'element'%)";
但它无法正常工作。
可以有人帮帮我吗?
but it is not working.
Can Some one Help me?
推荐答案
query =SELECT * FROM tbl_name WHERE soundex(fieldname)LIKE soundex(%'element'%);
query = "SELECT * FROM tbl_name WHERE soundex(fieldname) LIKE soundex(%'element'%)";
但它无法正常工作。
有人可以帮帮我吗?
but it is not working.
Can Some one Help me?
你不能使用 SOUNDEX [< a href =http://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_soundex\"target =_ blanktitle =New Window> ^ ]就像这样。但你可以这样做
You cannot not use SOUNDEX[^] like that. But you can do
SELECT * FROM tbl_name WHERE fieldname SOUNDS LIKE 'element'
You can use the following :
这篇关于如何在Mysql中使用LIKE%..%和Soundex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文