Home Tutorial Php Sql MySQL ASCII Function

 
 

MySQL ASCII Function
Posted on: December 9, 2010 at 12:00 AM
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              |
+-------------+---------------------+

 

Related Tags for MySQL ASCII Function:


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.