ORDER BY
Try it yourself →Sorts the result.
Syntax
SELECT ... ORDER BY column [DESC];
Description
Default is ascending (ASC); DESC sorts in descending order.
Example
CREATE TABLE k(name TEXT, score INTEGER);
INSERT INTO k VALUES ('Alex', 95), ('Sam', 88), ('Zoe', 99);
SELECT name FROM k ORDER BY score DESC;Expected output
Zoe Alex Sam
When to use?
Ordered lists (highest score, etc.).