Home Tutorial Php Sql MySQL ASCII

 
 

MySQL ASCII
Posted on: December 9, 2010 at 12:00 AM
This example illustrates how to use the ASCII character set.

MySQL ASCII

This example illustrates how to use the ASCII character set.

The ASCII Returns the numeric value of the leftmost character of the string. It returns 0 if str is the empty string. Returns NULL if str is NULL. ASCII() works for 8-bit characters.

Query

SELECT ASCII('5');

Output

+------------+
| ASCII('5') |
+------------+
| 53         |
+------------+

Query

SELECT ASCII(2);

+----------+
| ASCII(2) |
+----------+
| 50       |
+----------+

Query

+------------------+
| ASCII('sandeep') |
+------------------+
| 115              |
+------------------+

Query

+-------------+
| ASCII('dx') |
+-------------+
| 100         |
+-------------+

Related Tags for MySQL ASCII:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.