1. 程式人生 > >mysql 中的 not like 另一種簡化方法。

mysql 中的 not like 另一種簡化方法。

ont pan 簡化 regex regexp from sel span rom

第一種 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 另一種簡化方法。