TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

SQLite Order by Clause

SQLite Order by Clause with history, features, advantages, installation, commands, syntax, datatypes, operators, expressions, databases, table, crud operations, clauses, like, glob, limit, and clause, advance sqlite

<< Back to SQLITE

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:

SELECT column-list 
FROM table_name 
[WHERE condition] 
[ORDER BY column1, column2, .. columnN] [ASC | DESC]; 

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:

Sqlite Order by clause 1

Example1:

Select all records from "STUDENT" where FEES is in ascending order:

SELECT * FROM STUDENT ORDER BY FEES ASC; 

Output:

Sqlite Order by clause 2

Example2:

Fetch all data from the table "STUDENT" and sort the result in descending order by NAME and FEES:

SELECT * FROM STUDENT ORDER BY NAME, FEES DESC; 

Output:

Sqlite Order by clause 3




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf