【发布时间】:2014-02-13 21:42:11
【问题描述】:
我对在 where 条件下使用“不喜欢”的 mysql 选择有问题。表中有 15k 条记录。 3k 记录在 col1 列中的值为“test”。
这个选择工作正常:
select
*
from
`table`
where
`col1` like 'test'
已选择 3000 行。这是正确的。
但如果我尝试这个选择:
select
*
from
`table`
where
`col1` not like 'test'
选择了 0 行,而我预计 12000 行。
如果有任何想法,我将不胜感激?
【问题讨论】:
-
你能在 sqlfiddle 做一个小例子吗?
-
不确定,但请尝试两个不同的查询,例如
col1 like '%test%'和col1 NOT like '%test%' -
对我来说很好:sqlfiddle.com/#!2/59eb8e/3
-
它在 sqlfiddle 上运行良好,但在我的数据库中仍然无法运行。