日期:2014-05-16  浏览次数:20952 次

如何进行按匹配度高低进行排序?
如果要匹配的原文是she is my,怎么让下面的数据按照匹配的多少进行排序?



数据库内容:
she is my sin she is is she
she is is she she she she sin sin
she is my sin she is my
she is my Girl friend she
she is my Son she my


下面这个可以的,但是只能进行一个单词,3个单词该如何写?
SELECT *  
FROM sjk
ORDER BY LENGTH( REPLACE( biaoti, 'she', '' ) ) - LENGTH( biaoti )

------解决方案--------------------
REPLACE( biaoti, 'she', '' )
把biaoti这个字段里面的she字符替换成空

LENGTH(biaoti)
标题字段的长度