开发者

Can't we use [specifier] with like operator with Oracle?

开发者 https://www.devze.com 2023-02-01 17:45 出处:网络
When using the LIKE operator in oracle for matching anyone of the characters can\'t I use [specifier]

When using the LIKE operator in oracle for matching anyone of the characters can't I use [specifier] For eg. Find out the Customer's name starting with either 's' or 'r' SO we can't write query as " select * from emp where customer LIKE '[sr]%'";

Can't we use "[]" brac开发者_开发知识库es with LIKE operator in ORACLE?


No, LIKE does not do that.

But you can use regular expressions.

select * from emp where REGEXP_LIKE (customer, '^[sr].*');
0

精彩评论

暂无评论...
验证码 换一张
取 消