Return the ASCII value of the initial character in the string “CustomerName”:
SELECT ASCII(CustomerName) AS NumCodeOfFirstChar FROM Customers; |
The ASCII() function retrieves the ASCII value associated with a particular character.
ASCII(character) |
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. |
Works in: |
From MySQL 4.0 |