Home Sql Mysql-example MySQL Ascending Command

Related Tutorials


 
 

Share on Google+Share on Google+

MySQL Ascending Command

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

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

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  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.

Posted on: February 4, 2009

Related Tutorials

Discuss: MySQL Ascending Command  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
shristi hooda
February 5, 2012
mysql querry foe the current date and time

how to make a querry in mysql to show the current date and time
DMCA.com