Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use LIKE operator???

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
When I use the LIKE operator to find a String. How can I solve with the % and _ character.
If I want to find a record which contains a readly character '%' and '_'
For examples : I want to search in table A where the field name must include a string ' aa%aa '.
How to solve if I use Like operator
Select * from A where name LIKE ' aa%aa '
and may be the result is false.
 
try this
select * from table_name where col1 like '%\%%' escape '\';
 
Or, in sqlplus

SET ESCAPE
SELECT *
FROM table1
WHERE col1 LIKE '%\%%';
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top