

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 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 Questions & Answers
- 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 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?
- How can I use MySQL INTERVAL() function with a column of a table?
- Best way to update a single column in a MySQL table?
- 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 do I insert multiple values in a column with a single MySQL query?
- How to update a MySQL table by swapping two column values?
- Can I get the count of repeated values in a column with MySQL?
- How can I update the boolean values in MySQL?
- 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
Advertisements