New to sql and db2 queries. I have a table that will contain both numbers and alphanumeric values. They column is defined as VARCHAR. I am trying to compare the column with another value (which is more likely numbers only) if they fall within a range.
SELECT COL1
FROM TABLE1
WHERE COL1 >= RANGE_START AND COL1 <= RANGE_END;
Consider the table contains below values in COL1.
106
1000003000
A105
ABCDD
RANGE_START as 1000000000
RANGE_END as 3000000000
When I run the query it also gives 1000003000 and 106 as a satisfying condition. Why would it give 106? Any help in this is greatly appreciated.
Thanks