MySQL Ascending Command

MySQL Ascending is used to return the records from a table in the ascending order.

MySQL Ascending Command

MySQL Ascending Command

     

MySQL Ascending is used to return the records from a table in the ascending order. The section will provides you the mean for arranging the data of database table in ascending order. The ascending order sorts the records from the smallest to largest number in sequence like 10,15,25,30...

Understand with Example

The Tutorial illustrate an example from 'MySQL Ascending Command'. To understand the example we execute SELECT ASCII (name), name FROM emp order by name that sort the data of the 'emp' table in ascending order. The ORDER BY clause is used to sort the records on the basis of name.

List of Syntax:

ASC clause: This is used to arrange data in ascending order.

ORDER BY: This is used to sort the records in the specific columns of a table.

 

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