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

北慕城南 提交于 2020-07-16 07:16:25

问题


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 "[]" braces with LIKE operator in ORACLE?


回答1:


No, LIKE does not do that.

But you can use regular expressions.

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


来源:https://stackoverflow.com/questions/4529352/cant-we-use-specifier-with-like-operator-with-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!