Home > Backend Development > PHP Tutorial > mysql怎样查询不包括某个字符的结果?

mysql怎样查询不包括某个字符的结果?

WBOY
Release: 2016-06-23 14:14:39
Original
6010 people have browsed it

MySQL

比如,我想查询不包括“张”,“王”,“李”这几个姓的结果。该 怎么写?

回复讨论(解决方案)

贴出表结构看看,数据是如何组织的。贴出一些示例数据。

贴出表结构看看,数据是如何组织的。贴出一些示例数据。
就一个字段,全是人名

select * from tt where 字段 not like '%张%'  and 字段 not like '%王%' and 字段 not like '%李%'

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template