Order By Clause in MySql
SUMMARY:
In this video we will learn about Order By Clause in MySql. By default mysql fetches all records in ascending manner. To fetch records in ascending manner by query we use ASC clause.To fetch records in descending manner we use DESC clause.
WHAT IS ORDER BY CLAUSE
Generally order by statement is used for sort the data as per the requirement.
If we set query without specifying any order by asc or desc by default is will sorted data ascending manner.
If we use order by query first asc one column and second desc another column then it first sort first column asc order then using the result set it will desc the other column.
REFERENCE
This above video will guide you as per your requirement.
EXAMPLE OF ORDER BY CLAUSE
In this above video we have some queries . These are given below.
1) First we have fetched records from table for ename ascending order.
2) Second we have fetched records from table for deptname desc order.
3) Third we have fetched records from table for ename ascending order and using the result set we have fetched records from table for deptname desc order.
To know more details follow my Website : techrideradmin.blogspot.com.
0 Comments