
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How to display a single quote text as a column value in MySQL?
To display a single quote text, use double quotes like if you want to write You’ve, then write You've while inserting i.e. with double-quotes. Let us first create a table −
mysql> create table DemoTable ( Note text ); Query OK, 0 rows affected (0.57 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('You''ve seen the Taj? When?'); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable values('You''ve visited the US?'); Query OK, 1 row affected (0.16 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output. Here, the text You’ve is correctly visible −
+---------------------------------+ | Note | +---------------------------------+ | You've seen the Taj? When? | | You've visited the US? | +---------------------------------+ 2 rows in set (0.00 sec)
- Related Articles
- Concatenate the column values with separate text in MySQL and display in a single column
- Java Program to display double and single quote in a string
- How do I insert a special character such as ' (single quote) into MySQL?
- How to quote values of single column using GROUP_CONCAT and CONCAT with DISTINCT in MySQL?
- How can I update MySQL table after quoting the values of a column with a single quote?
- Updating only a single column value in MySQL?
- Update only a single column value in MySQL
- How to display a URL which explains the quote/deleted/inserted text in HTML?
- MySQL query to display columns name first name, last name as full name in a single column?
- Select multiple columns and display in a single column in MySQL?
- How to display column values as CSV in MySQL?
- Subtracting a number from a single MySQL column value?
- How to remove single quote from string column in an R data frame?
- How to make MySQL display results in a single line?
- Write a single MySQL query to exclude a record and display NULL value

Advertisements