
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
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)
- Related Articles
- How can we see the source code of a particular MySQL stored procedure?
- How can we see the source code of a particular MySQL stored function?
- How can we check the default character sets of a particular MySQL database?
- What function in MySQL can be used to get the number code of a specific character?
- How can we check the character set of all the tables in a particular MySQL database?
- How can we get the list of tables in a particular database from MySQL Server command line?
- How can we get the structure of a MySQL view as we can get the structure of a MySQL table?
- How can we get the definition of a MySQL view as we can get the definition of a MySQL table?
- Get the names beginning with a particular character using LIKE in MySQL
- Can we get total number of rows in a MySQL database?
- Get the number of rows in a particular table with MySQL
- How can we see the list of views stored in a particular MySQL database?
- In MySQL, how we can get the corresponding string representation of the binary value of a number?
- How can we ENABLE AND DISABLE a particular MySQL event?
- How can we get the total number of rows affected by MySQL query?

Advertisements