How to search data from oracle database which contains single quote
22,107
Solution 1
You have to escape the single quotes in the expressions by doubling them, e.g.:
select * from my_table
where name like '%''%'
or address1 like '%''%'
or address2 like '%''%';
Solution 2
... where name || address1 || address2 like '%''%';
Comments
-
MAS1 almost 4 years
my_table
contains three columns:name
,address1
, andaddress2
.I want to find all records which contains single quotes. How can I do this?