I’m in Oracle 10, and need an equivalent of
where col like 'str%'
but where the %-part is not optional. The result of str
is not allowed.
Is the following correct?
WHERE REGEXP_LIKE (col, '^str(*)+');
https://www.techonthenet.com/oracle/regexp_like.php
Reason:
1) Match any character, (*)
2) Occurrence must be at least 1, +
Advertisement
Answer
You can use _
:
where col like 'str_%'
This requires at least one character after the 'str'
.
If you want regular expressions, the simplest is probably:
WHERE REGEXP_LIKE(col, '^str.');