Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

ASCII

Example

Provide the ASCII value of the initial character in “CustomerName”.

SELECT ASCII(CustomerName) AS NumCodeOfFirstChar
FROM Customers;  

Definition and Usage

The ASCII() function retrieves the ASCII value corresponding to a particular character.

Syntax

ASCII(character)

Parameter Values

Parameter

Description

character

Mandatory. Specifies the character for which to retrieve the ASCII value. If multiple characters are provided, only the value for the first character will be returned.

Technical Details

Works in: From MySQL 4.0