views:

48

answers:

2

Hi All,

i have one table my_table,which contains three columnn namely name,address1,address2. Now i want to search a data from these 3 column which contains single quote. Can anybody suggest. Thanks in advance.

+7  A: 

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 '%''%';
Frédéric Hamidi
ouch, 16 sec faster
asalamon74
Thanks for instatnt reply.+1
MAS1
+1  A: 

... where name || address1 || address2 like '%''%';

dg157