THE WORLD'S LARGEST WEB DEVELOPER SITE

MySQL ASCII() Function

❮ MySQL Functions

Example

Return the ASCII value of the first character in "CustomerName":

SELECT ASCII(CustomerName) AS NumCodeOfFirstChar
FROM Customers;
Try it Yourself »

Definition and Usage

The ASCII() function returns the ASCII value for the specific character.

Syntax

ASCII(character)

Parameter Values

Parameter Description
character Required. The character to return the ASCII value for. If more than one character is entered, it will only return the value for the first character

Technical Details

Works in: From MySQL 4.0

❮ MySQL Functions