Q:

Can not exclude values with NOT IN

I have a query that calculates the number of records excluding certain values, I tried to use <>, NOT LIKE and NOT IN but no luck, these values still shown.
SELECT * 
FROM `stmaintble` 
WHERE `stantithromb` <> 'Non prescribed' 
AND `stantithromb` <> 'Aspirin  75-150 mg'

Also tried:
SELECT * 
FROM `stmaintble` 
WHERE `stantithromb` NOT IN('Non prescribed', 'Aspirin  75-150 mg')

This doesn't work either:
SELECT * 
FROM `stmaintble` 
WHERE `stantithromb` NOT IN('Non prescribed, Aspirin  75-150 mg')

Thank for help.

A:

If stantithromb has other text in that field (i.e. values look like 'Non prescribed some drug'). Then you'll need to use a wildcard LIKE search:
SELECT * 
FROM stmaintble 
WHERE stantithromb NOT LIKE '%Non prescribed%' 
  AND stantithromb NOT LIKE '%Aspirin  75-150 mg%'

