
- 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
What function in MySQL can be used to get the number code of a specific character?
String function ASCII() in MySQL returns the ASCII number code of the specific character.
Syntax
ASCII(str)
Here, str, the argument of ASCII() function, is the string whose ASCII value of the first character to be retrieved.
It is pertinent to mention here that 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('A') as 'ASCII VALUE OF CAPITAL A'; +--------------------------+ | ASCII VALUE OF CAPITAL A | +--------------------------+ | 65 | +--------------------------+ 1 row in set (0.00 sec) mysql> SELECT ASCII('a') as 'ASCII VALUE OF CAPITAL a'; +--------------------------+ | ASCII VALUE OF CAPITAL a | +--------------------------+ | 97 | +--------------------------+ 1 row in set (0.00 sec) mysql> SELECT ASCII('Abhay') as 'Left_most Character ASCII value'; +---------------------------------+ | Left_most Character ASCII value | +---------------------------------+ | 65 | +---------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- In MySQL, how can we get the number code of a particular character?
- What kind of compound units can be used in MySQL EXTRACT() function?
- How can MySQL COALESCE() function be used with MySQL SUM() function to customize the output?
- Can a number be used to name a MySQL table column?
- How can Tensorflow and Python be used to get code point of every word in the sentence?
- MySQL query to get all characters before a specific character hyphen
- How can MySQL FIND_IN_SET() function be used to get the particular record(s) from the table as a result set?
- How Groups function can be used in MySQL SELECT clause?
- How can I get the number of times a specific word appears in a column with MySQL?
- Which MySQL function can be used to find out the length of the string in bits?
- Which punctuation character can be used as the delimiter between MySQL date parts?
- Which punctuation character can be used as the delimiter between MySQL time parts?
- Which MySQL function can be used to append values of a column with single quotes?
- How number values be used as arguments in MySQL STRCMP() function?
- How can MySQL REPLACE() function be used with WHERE clause?

Advertisements