I'd like to filter my rows based on a numeric column. Problem is that the input is a pattern - for e.g. - a number starting with 2045 or something. I could do this:
where num_column like '2045%';
If the number is in a particular range, then you could do something like:
where num_column >= 2045000 and num_column < 2046000
I am guessing that is not the case . . . although you could extend this:
where (num_column >= 2045 and num_column < 2046) or (num_column >= 20450 and num_column < 20460) or (num_column >= 204500 and num_column < 204600) or . . .
I'm not sure if Oracle would really use an index for a complicated
There is another solution. Create an index on an expression and use the expression:
create index idx_mytable_numcolumn_str on my_table(to_char(num_column));
Then you can do:
where to_char(num_column) like '2045%'