- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Find records with double quotes in a MySQL column?
Use LIKE to find records with double quotes. Following is the syntax −
select *from yourTableName where yourColumnName LIKE '%"%';
Let us first create a table −
mysql> create table DemoTable740 (Value varchar(100)); Query OK, 0 rows affected (0.49 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable740 values("\""); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable740 values("\"John"); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable740 values("Sam"); Query OK, 1 row affected (0.12 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable740;
This will produce the following output -
+-------+ | Value | +-------+ | " | | "John | | Sam | +-------+ 3 rows in set (0.00 sec)
Here is the query to find records with double quotes in MySQL−
mysql> select *from DemoTable740 where Value LIKE '%"%';
This will produce the following output -
+-------+ | Value | +-------+ | " | | "John | +-------+ 2 rows in set (0.00 sec)
Advertisements