 
 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 we produce a string, other than default binary string, in a given character set by MySQL CHAR() function?
We can use the keyword USING to produce a string, other than default binary string, in a given character set. Following result set will demonstrate it −
mysql> Select CHARSET(CHAR(85 USING utf8)); +------------------------------+ | CHARSET(CHAR(85 USING utf8)) | +------------------------------+ | utf8 | +------------------------------+ 1 row in set (0.00 sec)
The above result set shows that the returned binary string is utf8 because we write utf8 after the keyword USING.
mysql> Select CHARSET(CHAR(85 USING latin1)); +--------------------------------+ | CHARSET(CHAR(85 USING latin1)) | +--------------------------------+ | latin1 | +--------------------------------+ 1 row in set (0.00 sec)
The above result set shows that the returned binary string is latin1 because we write latin1 after the keyword USING.
Advertisements
                    