Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

ASCII

Example

Return the ASCII value of the initial character in the string “CustomerName”:

SELECT ASCII(CustomerName) AS NumCodeOfFirstChar
FROM Customers;

Definition and Usage

The ASCII() function retrieves the ASCII value associated with a particular character.

Syntax

ASCII(character)

Parameter Values

Parameter

Description

character

The ASCII() function requires a single character input to return its ASCII value. If multiple characters are provided, it considers only the first character.

Technical Details

Works in:

From MySQL 4.0