Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个表,其中包含一个名为 foo 的字段。Foo 是一个字符字段。我想返回 foo 所在的所有记录:
这是我所拥有的,但我正在尝试如何获得“96321”
SELECT * FROM mtable WHERE foo NOT IN ('ad' , 'ca', 'qw') AND foo NOT LIKE '9%';
使用 OR 条件,查询如下:
SELECT * FROM mtable WHERE foo NOT IN ('ad' , 'ca', 'qw') AND (foo NOT LIKE '9%' OR foo='96321');