Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

Mysql ASC Order

Mysql ASC Order is used to sort the result set by ascending or descending order. The Order by CLAUSE sort the result by specified column.

Ads

Mysql ASC Order

     

Mysql ASC Order is used to sort the result set by ascending or descending order. The Order by CLAUSE sort the result by specified column.

Understand with Example

The Section of this Tutorial illustrate an example from 'Mysql Asc Order'. To understand the example we create a table 'Stu'. The create table keyword is used in creating a table 'Stu'.

The section of this tutorial illustrate an example from 

 

 

 

Create Table Stu

Create Table Stu(Id int,Name Varchar(15));

Insert values into Stu

Now we insert the values using insert into keyword that add the records or rows into table 'Stu'.

Insert Into Stu values(1,'Ajay');
Insert Into Stu values(2,'Bhanu');
Insert Into Stu values(4,'Rakesh');
Insert Into Stu values(5,'Santosh');
Insert Into Stu values(3,'Komal');

Stu

+------+---------+
| Id   | Name    |
+------+---------+
| 1    | Ajay    |
| 2    | Bhanu   |
| 4    | Rakesh  |
| 5    | Santosh |
| 3    | Komal   |
+------+---------+

Query

The Query given below sort the records from 'stu' in ascending order.

Select * from Stu order by id ASC;

Result

+------+---------+
| Id   | Name    |
+------+---------+
| 1    | Ajay    |
| 2    | Bhanu   |
| 3    | Komal   |
| 4    | Rakesh  |
| 5    | Santosh |
+------+---------+

Advertisements

Ads

Online Training Classes

Share on Google+Share on Google+

Mysql ASC Order

Posted on: January 20, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: Mysql ASC Order  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads