mysql 中的 not like 另一种简化方法。

Posted 草根级

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 中的 not like 另一种简化方法。相关的知识,希望对你有一定的参考价值。

第一种 not like 方法

select * from table where `zongbu` not like ‘%北京%‘ and `zongbu` not like ‘%上海%‘ and `zongbu` not like ‘%深圳%‘ and `zongbu` not like ‘天津‘ and `zongbu` not like ‘香港‘ and `zongbu` not like ‘沈阳‘

第二种 not like 方法

SELECT * FROM table WHERE zongbu NOT REGEXP ‘北京|上海|深圳|天津|香港|沈阳‘;


以上是关于mysql 中的 not like 另一种简化方法。的主要内容,如果未能解决你的问题,请参考以下文章