I would like to query a table where I am comparing against a regular expression and then of those results I want to filter out any that begin with 999
Here’s the query I have, but this returns no results:
Select * FROM my_table
WHERE REGEXP_LIKE(my_row, '[a-zA-Z]')
AND my_row NOT LIKE '999%'
Any ideas where I’m going wrong with this? I know that I should be getting several results.
Sample date would be like the following…
my_row
______
12345
45673
G12354
1234B
999RT
Given this test data:
Your query returns these results:
Here’s a SQL Fiddle to prove it.
These seem to be the rows we would expect to be returned by your logic so the problem is clearly in your data.