![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
In MySQL, how can we get the number code of a particular character?
With the help of MySQL string function ASCII(), we can get the number code of a particular character. Its syntax is ASCII(str) where, str, the argument of ASCII() function, is the string whose ASCII value of the first character to be retrieved.
It will return the number code the left the most character i.e. first character of the string given as argument.
Example
mysql> Select ASCII('T'); +------------+ | ASCII('T') | +------------+ | 84 | +------------+ 1 row in set (0.01 sec) mysql> Select ASCII('t'); +------------+ | ASCII('t') | +------------+ | 116 | +------------+ 1 row in set (0.00 sec) mysql> Select ASCII('Tutorialspoint'); +-------------------------+ | ASCII('Tutorialspoint') | +-------------------------+ | 84 | +-------------------------+ 1 row in set (0.00 sec) mysql> Select ASCII('tutorialspoint'); +-------------------------+ | ASCII('tutorialspoint') | +-------------------------+ | 116 | +-------------------------+ 1 row in set (0.00 sec)
Advertisements