Settings | Sign in | Sign up

There are currently 3 posts.

【资料】SQL语句中使用正则表达式

Floor 1 巨大八爪鱼 11/19/10 23:57
可以用 regexp 关键字来实现。
比如:我想搜索 admin 表中 username 字段为数字的记录。则可以使用下面的 SQL 语句:
select * from articles where title regexp '[0-9].+';
Floor 2 巨大八爪鱼 11/19/10 23:59
例子:select * from 帖子 where 标题 regexp '[Uu]buntu'
Floor 3 巨大八爪鱼 11/19/10 23:59
显示行 0 - 25 (26 总计, 查询花费 0.0305 秒)SELECT *
FROM 帖子
WHERE 标题
REGEXP '[Uu]buntu'
LIMIT 0 , 30

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
©2010-2025 Purasbar Ver3.0 [Mobile] [Desktop]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license.