I have a table with a column named filename. I am trying to delete all of my records that start with a "9-" except not delete records that start with "9-5400". This statement doesn't work:
delete from tblmaster where substring(filename,1,2) = '9-' and substring(filename,1,6) != '9-5400'
Can someone help me rephrase this string so it ignores the 9-5400 but deletes everything else that starts with 9-.