Home Tutorial Php Sql MySQL ASCII Function

 
 

Share on Google+Share on Google+
MySQL ASCII Function
Posted on: December 9, 2010 at 12:00 AM
Advertisement
This example illustrates how to find the ASCII value of a string.

MySQL ASCII Function

This example illustrates how to find the ASCII value of a string.

In this example we find the ASCII value of name field from emp table. ASCII (American Standard Code for Information Interchange) is used to built-in binary code for representing characters in all computers. It was developed for communications and uses only seven bits per character, providing 128 combinations that include upper and lower case alphabetic letters, the numeric digits and special symbols such as the $ and %. The first 32 characters are set aside for communications and printer control.

 

 

Query

 

SELECT ASCII(name), name FROM emp;

 

Output

 

+-------------+---------------------+
| ASCII(name) | name                |
+-------------+---------------------+
| 115         | sandeep kumar suman |
| 97          | anusmita            |
| 114         | ravikant sachan     |
| 115         | suman saurabh       |
| 114         | rakesh              |
| 110         | noor                |
| 103         | girish tewari       |
| 107         | komal choudhary     |
| 104         | hardeep             |
| 100         | deepak mohanty      |
| 118         | vinod kumar         |
| 118         | vikash              |
| 97          | amit raghuvanshi    |
| 118         | vineet bansal       |
| 97          | amardeep patel      |
| 115         | saurabh             |
| 115         | santosh kashyap     |
| 103         | govind              |
+-------------+---------------------+

 

Advertisement

Related Tags for MySQL ASCII Function:


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.

Posted on: December 9, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com