The MYSQL ORDER BY Clause is used to sort the result-set in ascending or descending order. To sort the result set, you must use the ORDER BY clause. MySQL ORDER BY can be used to for single column or multiple columns.
To sort the result set from existing table, use the following syntax:
Parameters:
tablename: The table name from which you want to remove all records.
ASC: To sort data set in ascending order.
DESC: To sorts data set in descending order.
Note:
In the above example, we have fetched records from "tblCustomerLoan" table without specifying ASC or DESC in order by clause.
You can use MySQL Command Line Client to fetched records from from "tblCustomerLoan" table without using ASC or DESC in order by clause.It will look like this:
Note:
In the above example, we have fetched records from "tblCustomerLoan" table with ASC attribute in order by clause.
You can use MySQL Command Line Client to fetch records from from "tblCustomerLoan" table with using ASC in order by clause.It will look like this:
Note:
In the above example, we have fetch records from "tblCustomerLoan" table with DESC attribute in order by clause.
You can use MySQL Command Line Client to fetch records from "tblCustomerLoan" table with using DESC in order by clause.It will look like this:
Note:
In the above example, we have fetch records from "tblCustomerLoan" table with ASC & DESC attribute in order by clause.
You can use MySQL Command Line Client to fetch records from "tblCustomerLoan" table with using ASC & DESC in order by clause.It will look like this: