SQL> select * from t_char;
--------------------
A_ B
Acb
A % B
A' B
A/B
A \ B
%
_
ASQL> select * from t_char where a like 'A _ B ';
--------------------
A_ B
Acb
A % B
A' B
A/B
A \ bSQL> select * from t_char where a like 'a \ _ B 'escape' \ ';
--------------------
A_ B -- visible to query strings with wildcard characters, you must use the escape Function SQL> select * from t_char where a like 'a \ 'B' escape '\';
ERROR:
ORA-01756: quoted string not properly terminated
SQL> select * from t_char where a like 'A' B 'escape' \ ';
--------------------
A' B -- but the character 'still needs two ''to replace the single quotation mark SQL> select * from t_char where a like 'ax _ B' escape 'X';
--------------------
A_ B SQL> select * from t_char where a like 'A' _ B 'escape ''';
--------------------
A_ B SQL> select * from t_char where a like 'A _ % B 'escape' _ ';
--------------------
A % B -- other characters or even "'", "_", and "%" can be used as escape characters, but \ is generally used \, to avoid logical errors SQL> select * from t_char where a like 'a \/B 'escape '\';
Select * from t_char where a like 'a \/B 'escape '\'
*
ERROR at line 1:
ORA-01424: missing or illegal character following the escape character
SQL> select * from t_char where a like 'A _/B 'escape '_';
Select * from t_char where a like 'A _/B 'escape '_'
*
ERROR at line 1:
ORA-01424: missing or illegal character following the escape character SQL> select * from t_char where a like 'a // B 'escape'/';
--------------------
A/bSQL> select * from t_char where a like 'A/\ B 'escape '/';
Select * from t_char where a like 'A/\ B 'escape '/'
*
ERROR at line 1:
ORA-01424: missing or illegal character following the escape characterSQL> select * from t_char where a like 'a \ B 'escape' \ ';
--------------------
A \ B
-- To search for "/" or "\", you must use the same symbol as the Escape Character. Otherwise, the usage is basically invalid. Pay attention to this, the escape function is irrelevant to the escape environment parameters in sqlplus.
SQL> show escape
Escape OFF