escape
escape是转义字符的关键字,用于转义通配符,提取字段字符里有通配符值的记录。
select f.*
from temp_ltao f
where b like '字符串' escape '/';
将字符串中/后面的字符转义。
// 转义/
/% 转义%
/_ 转义_
例如:
select f.*,f.rowid
from temp_ltao f
where b like '%/%%' escape '/'; --转义第二个%
但需要注意'例外,字符'还是需要用两个''来代替字符串中的单引号
例如:
select * from t_char where a like 'a\'b' escape '\';
ERROR:ORA-01756: quoted string not properly terminated
正确:
select * from t_char where a like 'a''b'