Level 73
There are a few ways to do this.
- create two queries one for the pinned and one for the unpinned.
- Add a column pinned and write a query that orders nulls last.
Option 2:
SELECT product, number, ISNULL(pinned) FROM products
ORDER BY ISNULL(pinned) ASC, number ASC;
More info can be found here
https://gregrs-uk.github.io/2011-02-02/mysql-order-by-with-nulls-first-or-last/