-- Ascending SELECT * FROM products ORDER BY price; -- Descending SELECT * FROM products ORDER BY price DESC;
We can also sort by alphabetical order.
-- Sort in alphabetical order SELECT * FROM products ORDER BY name;
You can also order by multiple different properties in order of declaration.
SELECT * FROM products ORDER BY price, weight;
OFFSET
skips the first N records.LIMIT
only give first N records of a result.SELECT * FROM products ORDER BY price, weight OFFSET 2 LIMIT 3;