- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
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
How to escape single quotes in MySQL?
We can escape single quotes with the help of the SELECT statement. For instance, when single quotes are encountered in a name, eg. “Carol’s”.
Let us see the syntax.
SELECT ‘SomeValue’;
Here is an example that display how to include text with single quotes.
mysql> SELECT 'Carol\'s Taylor.';
The following is the output.
+-------------------+ | Carol's Taylor | +-------------------+ | Carol's Taylor | +-------------------+ 1 row in set (0.00 sec)
- Related Articles
- How to insert date in single quotes with MySQL date formats?
- Using MySQL keywords in a query surrounded with single quotes?
- Single quotes vs. double quotes in C or C++\n
- How to escape apostrophe (') in MySQL?
- Single and Double Quotes in Perl
- Using single quotes around database and table name isn’t working in MySQL?
- How to escape backslashes in MySQL with JDBC?
- Why does the update command in MySQL insist on using slanted single quotes?
- How to add single quotes to strings in an R data frame column?
- Print newline in PHP in single quotes\n
- How to insert records with double quotes in MySQL?
- Which MySQL function can be used to append values of a column with single quotes?
- Is there a PHP function that only adds slashes to double quotes NOT single quotes
- How to include quotes in comma separated column with MySQL?
- How can we escape special characters in MySQL statement?

Advertisements