Home > Backend Development > PHP Tutorial > 如何查找一个mysql的表中,是否含有“你好”关键字

如何查找一个mysql的表中,是否含有“你好”关键字

WBOY
Release: 2016-06-06 20:14:16
Original
1132 people have browsed it

1、mysql中有一个数据表 words,表中有若干字段,如何写一个sql语句查找words表中含有“你好”关键字

回复内容:

1、mysql中有一个数据表 words,表中有若干字段,如何写一个sql语句查找words表中含有“你好”关键字

模糊查询 like

假如'你好'这个关键字是 属于 column1这个字段的,那么可以写sql如下:

<code>select * from words where column1 like '%你好%';
</code>
Copy after login

根据查询结果的条数来判断是否含有'你好'这个关键字.

Related labels:
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