[thelist] SQL: Like 'S%', but not like '%safety%'

Rob Smith rob.smith at THERMON.com
Wed Jan 19 09:26:14 CST 2005


Howdy,

I'm trying this simple simple SQL query, but for some odd reason, it's not
working. The subject line is pretty much it. Specifically:

...and ((o.PONumber like 'C%'  OR o.PONumber like 'S%') and (not o.PONumber
like '%safety%' or not o.PONumber  like '%saftey%')) ORDER BY ...

I want to pull up PO's that begin with 'C%' or 'S%', but at the same time,
it's also pulling up PO's with the word Safety (and the misspelled variety
of Saftey). 

Any ideas?

Rob Smith


More information about the thelist mailing list