Share on Google+Share on Google+

MySQL ASCII

Advertisement
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         |
+-------------+

Advertisements

Posted on: December 9, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.