一个sql很多个not like的简化语句

来源:互联网 发布:mysql错误1064 编辑:程序博客网 时间:2024/05/21 08:57
如:
select * from table where `zongbu` not like '%北京%' and `zongbu` notlike '%上海%' and `zongbu` not like '%深圳%' and `zongbu` not like '天津'and `zongbu` not like '香港' and `zongbu` not like '沈阳'

SELECT * FROM table WHERE zongbu NOT REGEXP'北京|上海|深圳|天津|香港|沈阳';
原创粉丝点击