Oracle中like查询下划线等特殊字符的处理ESCAPE Clause ExampleYou can include the actual characters "%" or "_" in the pattern by using the ESCAPEclause, which identifies the escape character. If the escape characterappears in the pattern before the character "%" or "_" then Oracleinterprets this character literally in the pattern, rather than as aspecial pattern matching character.
To search for employees with the pattern 'A_B' in their name:
SELECT last_name
FROM employees
WHERE last_name LIKE '%A\_B%' ESCAPE '\';
The ESCAPE clause identifies the backslash(\) as the escape character. In the pattern, the escape characterprecedes the underscore (_). This causes Oracle to interpret theunderscore literally, rather than as a special pattern matchingcharacter.