I want to find data with double quotes. I have the next simple query:
SELECT * FROM table_name WHERE column_name LIKE "%\"%";
But I have syntax error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"%\"%' at line 1
What should I do to find this data with double quotes(")?
Because the \ character is used by the LIKE operator itself you have to double it when you use it to escape another character like the double quote.
see here
SELECT * FROM table_name WHERE column_name LIKE "%\\"%";
should work for you.
as will changing out the double quotes for single quotes to enclose the literal
SELECT * FROM table_name WHERE column_name LIKE '%"%';
as you posted here
try
SELECT * FROM table_name WHERE column_name LIKE '%"%';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With