I have some number like
x
12000
13093
14013
14111
15543
16883
17932
18920
19903
20390
These numbers are only an example I have a lot of 14… a lot of 15… etc.
Now in WHERE
clause of a stored procedure, I want to exclude all numbers who start with 15 or less
so I can do something like:
WHERE TestColumn NOT LIKE '15%' AND TestColumn NOT LIKE '14%'
Is there a way to change this and use something like TestColumn NOT LIKE < '15%'
Advertisement
Answer
If the value of TestColumn is a string you could use a cast to integer of the two leftmost chars
WHERE cast(left(TestColumn,2) as int) <=15
and for what in your comment
WHERE cast(left(TestColumn,2) as int) <=15
and cast(lTestColumn as int) <>13093