Saturday 14 September 2013

Order By in SQL

Order by:-this command is used to sort the data present in the table.
by default it sorts the data in ascending order and if you want to sort in descending order you should use "desc" keyword

table on which we perform the order by operation.



Ex:-in this we select entire data from the table according to the age column which is ascending in order.


 Ex:-select the data in descending order on the basis of age column by using desc keyword.



 Ex:-in this we select the entire data on the basis of name column .it sorts the name column alphabetically and it is descending in nature because we use desc keyword.


 Ex:-we select data in which name is sorted in ascending order on the basis of alphabets.




No comments :

Post a Comment