Home > Database > Mysql Tutorial > mysql字符串匹配渡查询排序

mysql字符串匹配渡查询排序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:15:23
Original
1350 people have browsed it

mysql字符串匹配度查询排序 实现类搜索引擎的功能,实现匹配度查询 表结构创建语法 CREATE TABLE `people` ( `id` int(11) NOT NULL COMMENT 'id', `namess` varchar(200) DEFAULT NULL COMMENT '用户名', PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET

mysql字符串匹配度查询排序

  实现类似搜索引擎的功能,实现匹配度查询


  表结构创建语法   

CREATE TABLE `people` (
  `id` int(11) NOT NULL COMMENT 'id',
  `namess` varchar(200) DEFAULT NULL COMMENT '用户名',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
Copy after login

常规查询语句

SELECT * FROM `people` WHERE namess LIKE  '%张%'  ; 
Copy after login


使用匹配度查询sql

SELECT * FROM `people` WHERE namess LIKE  '%张%' 
ORDER BY  REPLACE(namess,'张','')  
Copy after login


Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template