我们不能在 Oracle 中使用带有 like 运算符的 [specifier] 吗? [英] Can't we use [specifier] with like operator with Oracle?

查看:50
本文介绍了我们不能在 Oracle 中使用带有 like 运算符的 [specifier] 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 oracle 中使用 LIKE 运算符匹配任何字符时,我不能使用 [说明符]例如.找出以s"或r"开头的客户名称,因此我们不能将查询写为" select * from emp where customer LIKE '[sr]%'";

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]%'";

我们不能在 ORACLE 中使用带有 LIKE 运算符的[]"大括号吗?

Can't we use "[]" braces with LIKE operator in ORACLE?

推荐答案

不,LIKE 不这样做.

No, LIKE does not do that.

但是你可以使用正则表达式.

But you can use regular expressions.

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

这篇关于我们不能在 Oracle 中使用带有 like 运算符的 [specifier] 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆