Use OR condition, query will be as per below:
SELECT
*
FROM
mtable
WHERE
foo NOT IN ('ad' , 'ca', 'qw')
AND (foo NOT LIKE '9%' OR foo='96321');
문제
Say I have a table with a field called foo. Foo is a character field. I want to return all records where foo is:
Here is what I have but I am tripping up on how to get '96321'
SELECT
*
FROM
mtable
WHERE
foo NOT IN ('ad' , 'ca', 'qw')
AND foo NOT LIKE '9%';
해결책
Use OR condition, query will be as per below:
SELECT
*
FROM
mtable
WHERE
foo NOT IN ('ad' , 'ca', 'qw')
AND (foo NOT LIKE '9%' OR foo='96321');