
- 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 can I update MySQL table after quoting the values of a column with a single quote?
As we know that with the help of QUOTE() function we can put the values of a column in single quotes. By using QUOTE() function with UPDATE clause we can update the table having quoted values. We need to give column name as the parameter of QUOTE() function. Following example will update the table ‘examination_btech’ after putting the values of column ‘Course’ in single quotes.
Example
mysql> UPDATE examination_btech SET Course = QUOTE(Course); Query OK, 10 rows affected (0.05 sec) mysql> Select * from examination_btech; +--------+----------+----------+ | RollNo | Name | Course | +--------+----------+----------+ | 1 | Rahul | 'B.Tech' | | 2 | Raman | 'B.Tech' | | 3 | Sahil | 'B.Tech' | | 4 | Shalini | 'B.Tech' | | 5 | Pankaj | 'B.Tech' | | 6 | Mohan | 'B.Tech' | | 7 | Yash | 'B.Tech' | | 8 | digvijay | 'B.Tech' | | 9 | Gurdas | 'B.Tech' | | 10 | Preeti | 'B.Tech' | +--------+----------+----------+ 10 rows in set (0.00 sec)
- Related Articles
- How can we update MySQL table after padding a string with the values of the column?
- How can we update MySQL table after removing a particular string from the values of column?
- How to quote values of single column using GROUP_CONCAT and CONCAT with DISTINCT in MySQL?
- How can we update columns values on multiple rows with a single MySQL UPDATE statement?
- How can I create a MySQL table with a column with only 3 possible given values?
- How can I create a stored procedure to update values in a MySQL table?
- How can we update values in a MySQL table?
- Best way to update a single column in a MySQL table?
- How to update a MySQL table by swapping two column values?
- How can I use MySQL INTERVAL() function with a column of a table?
- How do I insert multiple values in a column with a single MySQL query?
- How to display a single quote text as a column value in MySQL?
- Update only a single column in a MySQL table and increment on the basis of a condition
- How can I update the boolean values in MySQL?
- How can we update the values in one MySQL table by using the values of another MySQL table?

Advertisements