Sometimes, we also need to specify a particular order for sorting the results.
You can order results by a specific value with the
Let's sort plants by year, in a ascending order:
Open your browser and navigate to
And we got:
You can also add secondary sortings by chaining another
Let's sort plants by year, in a ascending order, then by scientific_name, in descending order:
Excluding null values
Sorting on a value that is possibly null will show the entries with null values first.
For example, if we want to get the tallest trees, we will have trees with
null maxmimum height first:
To avoid that, you can exclude null values (see Filtering):