109
SQLite ORDER BY Clause
The SQLite ORDER BY clause is used to sort the fetched data in ascending or descending order, based on one or more column.
Syntax:
You can use one or more columns in ORDER BY clause. Your used column must be presented in column-list.
Let’s take an example to demonstrate ORDER BY clause. We have a table named “STUDENT” having the following data:
Example1:
Select all records from “STUDENT” where FEES is in ascending order:
Output:
Example2:
Fetch all data from the table “STUDENT” and sort the result in descending order by NAME and FEES:
Output:
Next TopicSQLite Group By Clause