Dear all,
how to query a column that doesn't contain value with a particular letter in the middle of it using REGEXP_LIKE? Suppose I have the following:
SQL> select * from test;
TEMP
--------------------
john
joni
jane
johny
jonny
SQL> select temp from test where regexp_like(temp,'[^h]');
TEMP
--------------------
john
joni
jane
johny
jonny
SQL> select temp from test where regexp_like(temp,'[a-z]+[^h][a-z]+');
TEMP
--------------------
john
joni
jane
johny
jonny
The above code tries to query temp that doesn't contain letter 'h' in the middle (so it querries joni, jane, and jonny) but it cannot be done with
regexp_like(temp,'[^h]');
regexp_like(temp,'[a-z]+[^h][a-z]+');
since these 2 patterns satisfy all the available rows. What is the solution?
Best regards,
Val