下划线在oracle like子句中不起作用 [英] Underscore is not working in oracle like clause

查看:117
本文介绍了下划线在oracle like子句中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发时,我使用'test_1%'来查找'test_123'.但是在生产环境中它不起作用.使用'转义'\'是可行的.在oracle中需要设置什么设置吗?我想不加转义地使用'\''.

When development, I used 'test_1%' to find 'test_123' in like. But in production environment its not working. Using 'escape '\'' is working. is there any setting needs to set in oracle? I want to use without escape '\''.

推荐答案

在SQL Developer中尝试以下操作:

try this in SQL Developer:

SELECT * FROM TABLE1 WHERE NAME LIKE 'test\_1%' escape '\'

在sql plus中:

in sql plus:

set escape '\'
SELECT * FROM TABLE1 WHERE NAME LIKE 'test\_1%';

这篇关于下划线在oracle like子句中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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