☞ Following are the topics to be covered :
1. ORDER BY clause. 2. Fetching records in ascending order. 3. Fetching records in descending order. 4. Applying ascending and descending on multiple columns simultaneously.
☞ To sort the data in ascending or descending order, we use the ORDER BY clause.
☞ By default, it will sort the data in ascending order.
☞ To fetch records in ascending order, we use the ORDER BY clause.
☞ Syntax :
☞ Example :
☞ To fetch records in descending order, we use the ORDER BY - DESC command.
☞ Syntax :
☞ Example :
☞ Syntax :
☞ Example :