Home >php教程 >php手册 >在SQL语句中使用正则表达式

在SQL语句中使用正则表达式

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 09:54:211202browse

能,可以用 regexp 关键字来实现。
比如:我想搜索 admin 表中 username 字段为数字的记录。则可以使用下面的 SQL 语句:
select * from articles where title regexp '[0-9].+';

Statement:
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
Previous article:常见的几个问题Next article:MySQL数据的导出和导入