 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP 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)
Advertisements
 