![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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
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)
Advertisements