MySQL Ascending Command

This example illustrates how to display the data in the ascending order.

 
 

Share on Google+Share on Google+

MySQL Ascending Command

Ads

This example illustrates how to display the data in the ascending order.

MySQL Ascending Command

This example illustrates how to display the data in the ascending order.

In this example, the below table shows the data of the 'emp' table in ascending order. To sort a result, use an ORDER BY clause, default sort order is ascending. In the below table shows the name field in the ascending order.

 

 

 

Query

 

SELECT ASCII(name), name FROM emp order by name;

 

Output

 

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

 

Advertisements

Ads

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