Some background, I have a code column that is char(6). In this field, I have the values of 0,00,000,0000,000000,000000. It seems illogical but that's how it is. What i need to do is delete all rows that possess these code values. I know how to do it individually as such
delete from [dbo.table] where code='0'
delete from [dbo.table] where code='00'
and so on.
How does one do this one section of code instead of 6
IN/OR,REGEXP, andCONVERTto int), so I won't bother putting this into an answer. But keep in mind that if you have indexed thiscodecolumn, only the IN/OR answer will take advantage of the index. CONVERT (or pretty well any function) will prevent the index from being referenced, as well REGEXP.