蟋蟀
版主
  
村里巡逻队长
UID 67242
精华
0
积分 2036
帖子 1763
金钱 2036 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2005-12-17 来自 福建
状态 离线
|
[推荐阅读] 求一数码产品报价系统!
QUOTE: 原帖由 yueyang 于 2006-7-21 11:59 AM 发表
select * from test where article like '%ttt%';这个运行正常,列出了所有包含ttt的列,但怎样写列出不符合的列呢?
select * from test where article not like '%ttt%'; 这样写不行,全部都不列出来了。
... 这个方法很多,
可以用locate position 和instr函数 方法相同如下:
select * from `test` where locate("ttt",`article`)=0;
或者用正则
rlike regexp
select * from `test` where `article` rlike '[^ttt]*';
正则的这个有错误,知道的说一声,先谢了.
|  吉林php群
27089230 |
|