sql / beginner
Snippet
Sorting Results
The ORDER BY keyword is used to sort the result-set in ascending (ASC) or descending (DESC) order. Here, products are sorted from most expensive to cheapest.
snippet.sql
1
2
3
SELECT product_name, priceFROM productsORDER BY price DESC;
Breakdown
1
ORDER BY price DESC;
Sorts the results based on the price column in descending order.